Support » How-To and Troubleshooting » Switching to root without moving files from subdirectory

Switching to root without moving files from subdirectory

Viewing 6 replies - 1 through 6 (of 6 total)
  • esmi


    Forum Moderator

    esmi, in my original post, I referenced the link that you shared. It didn’t work for me.



    Forum Moderator

    Perhaps you were reading the wrong section of that page. The link I posted above should take you directly to the correct section.

    In my original post, I said that I followed the directions for “Using a pre-existing subdirectory install” on the aforementioned page. Is that the wrong section?



    Forum Moderator

    No. You need to re-read that section. The instructions that it contains do work. They have been tested successfully millions of times.

    Using a pre-existing subdirectory install
    If you already have WordPress installed in its own folder (e.g., http://example.com/wordpress), then the steps are as follows:

    1. Go to the General panel. (did this)

    2. In the box for Site address (URL): change the address to the root directory’s URL. Example: http://example.com (did this)

    3. Click Save Changes. (Do not worry about the error message and do not try to see your blog at this point! You will probably get a message about file not found.) (did this – no error message)

    4. Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress (wordpress in our example) directory into the root directory of your siteā€”the latter is probably named something like www or public_html. The .htaccess file is invisible, so you may have to set your FTP client to show hidden files. If you are not using pretty permalinks, then you may not have a .htaccess file. If you are running WordPress on a Windows (IIS) server and are using pretty permalinks, you’ll have a web.config rather than a .htaccess file in your WordPress directory. (did this)

    5. Edit your root directory’s index.php.
    Open your root directory’s index.php file in a text editor
    Change the line that says:
    require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );
    to the following, using your directory name for the WordPress core files:
    require( dirname( __FILE__ ) . ‘/wordpress/wp-blog-header.php’ );
    Save the file. (did this)

    6. Login to your site (if you aren’t still already). The URL should still be http://example.com/wordpress/wp-admin/ (did this)

    7. If you have set up Permalinks, go to the Permalinks panel and update your Permalink structure. WordPress will automatically update your .htaccess file if it has the appropriate file permissions. If WordPress can’t write to your .htaccess file, it will display the new rewrite rules to you, which you should manually copy into your .htaccess file (in the same directory as the main index.php file.) (did this. my permalinks were already set to “post name”.)

    Tried to view the site in my browser. Blank page.


Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Switching to root without moving files from subdirectory’ is closed to new replies.