Transfer your domain to us and save up to 6 months on webhosting purchase
India English
Kenya English
United Kingdom English
South Africa English
Nigeria English
United States English
United States Español
Indonesia English
Bangladesh English
Egypt العربية
Tanzania English
Ethiopia English
Uganda English
Congo - Kinshasa English
Ghana English
Côte d’Ivoire English
Zambia English
Cameroon English
Rwanda English
Germany Deutsch
France Français
Spain Català
Spain Español
Italy Italiano
Russia Русский
Japan English
Brazil Português
Brazil Português
Mexico Español
Philippines English
Pakistan English
Turkey Türkçe
Vietnam English
Thailand English
South Korea English
Australia English
China 中文
Somalia English
Canada English
Canada Français
Netherlands Nederlands

Moving a wordpress website from a subdirectory to the root (/public_html) directory

Login to the Cpanel

Move the files from the sub directory to the root (/public_html)

Select all files in the subdirectory

Click Move

 

 

Login to admin dashboard

www.mywebsite.com/wp-admin/

Go to the settings

Click on Permalinks

Click Save

This will rewrite url in the .htaccess

Install the Velvet Blues Update URLs plugin

Go to Tools

Click Update URLs

Under old URL write the url with the subdirectory

Under new URL write the url without subdirectory

Make sure to not include / at the end of the url

Do not click the Update all GIUDs

Click Update URLs Now

The plugin may miss a few updates in some areas – just check the following areas

Click on Appearance

Click on the Menu

Update the any custom url that not have been updated by the plugin

Go to Appearance

Click on the Theme Options

Check the URL of the uploaded content and update all the url removing the subdirectory

Go to Sliders

Check and update any URL that may still have the subdirectory –such as logo, images,

 

Reset the Cache – if you have any cache plugin – make sure you clear the cache

 

Check if the website is now working well.

To avoid losing SEO gains from the old website, set up .htaccess  and write the following

RewriteEngine On

RewriteCond %{HTTP_HOST} ^mydomain.com/subdirectory$ [OR]

RewriteCond %{HTTP_HOST} ^www.mydomain.com/subdirectory$

RewriteRule (.*)$ http://www.mydomain.com/$1 [R=301,L]

 

Make sure the format of the RewriteRule (with www or without www) is the same as set under Settings, General

 

 

Share some Love
× WhatsApp us