WordPress.org

Forums

Switching to root without moving files from subdirectory (7 posts)

  1. dojoge1
    Member
    Posted 1 year ago #

    I have WordPress installed in a subdirectory (http://jueikaodmd.com/wordpress) and I want to make it viewable from the root directory without moving all the files. I followed the directions for "Using a pre-existing subdirectory install" at http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory, but all I got was a blank page. I really don't want to move all the files, update the database, etc. Thanks in advance for your help!

  2. esmi
    Forum Moderator
    Posted 1 year ago #

  3. dojoge1
    Member
    Posted 1 year ago #

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

  4. esmi
    Forum Moderator
    Posted 1 year ago #

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

  5. dojoge1
    Member
    Posted 1 year ago #

    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?

  6. esmi
    Forum Moderator
    Posted 1 year ago #

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

  7. dojoge1
    Member
    Posted 1 year ago #

    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.

    Suggestions?

Topic Closed

This topic has been closed to new replies.

About this Topic