WordPress: migrate from one sub-directory to the root

Published by TheJoe on

Estimated reading time: < 1 minute


This article was published more than a year ago, there may have been developments.
Please take this into account.

Today's article is a bit’ technical, I had to delve into some trends that I was too light for some trouble when I installed WordPress combined (the engine of this blog) su

Here below the steps Blog with WordPress support to move an existing WordPress installation from within a folder, the root domain. As in my case it was installed in WordPress ““, the file index.php in the root directory instead was a simple redirect 301 alla directory “/wordpress“. It was uncomfortable to have the blog in another place than the root of the site, but it was even more uncomfortable showing the URL including “/wordpress/” users.

The steps are as follows:

  1. or al general control panel (“settings” – “General“),
  2. nel box “Website (URL)“: the address changes from “” a ““,
  3. click on “Save the changes” (do not worry about error messages, and do not try to open the blog at this point, in all probability will be shown the message “file not found“),
  4. copy (DO NOT MOVE) i file index.php and .htaccess from within the directory “/wp” root. The file .htaccess is invisible, it is possible that you will need to configure your FTP client so as to list them,
  5. edit the file index.php this time in your root directory as follows:
    1. open the file index.php present in the root with a text editor,
    2. change the following line:
      with this following expression:
    3. save the file.
  6. Log on the site (if you're not already logged in). The URL should still be “",
Look here:  Configure Apache after installation

It is important to follow these instructions to the letter, a small variation brings down the house of cards.


I keep this blog as a hobby by 2009. I am passionate about graphic, technology, software Open Source. Among my articles will be easy to find music, and some personal thoughts, but I prefer the direct line of the blog mainly to technology. For more information contact me.


Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.