Servage Magazine

Information about YOUR hosting company – where we give you a clear picture of what we think and do!

Move WordPress from sub-folder to main folder

Wednesday, April 21st, 2021 by Helge

UntitledYou installed your WordPress in a subfolder (e.g. http://domain.com/sub-folder) and you want to move it to the main folder (e.g. http://domain.com )? That is no problem! With few steps, you can do it. Here is a step by step guideline  for you:

You’re done !

  Ensure that the Rewrite code under .htaccess file is as below for wordpress:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Usually since the blog is installed under sub-folder, the rewrite code you will see as

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /sub-folder
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . sub-folder/index.php [L]
</IfModule>

# END WordPress

Since we have moved to root folder, so no need of ‘sub-folder’ now.

Important Note : Please make a local backup at your end before making these changes for security reasons for both files and databases.

 

Move WordPress from sub-folder to main folder, 4.8 out of 5 based on 4 ratings
Categories: Guides & Tutorials
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

No comments yet (leave a comment)

You are welcome to initiate a conversation about this blog entry.

Leave a comment

You must be logged in to post a comment.