Support » Fixing WordPress » Moving Site to Root Directory While WordPress is in subdirectory

  • Resolved Wicketty Wabbit


    I have a site in test right now at, with my blog integrated into it. I like the way it all functions.

    Now I want to have it take over my domain – as the main site.

    I read the document “Giving WordPress Its Own Directory” here:

    It says “If you already have WordPress installed in its own folder (i.e. then the steps are as follows:”

    This is precisely my situation.

    The two steps that puzzle me are:
    5. Open your root directory’s index.php file in a text editor
    6. Change the following and save the file. Change the line that says:
    to the following, using your directory name for the WordPress core files:

    I took a generic index.php file from WordPress and uploaded it to the root directory. But it does not have the line referenced in step 6.

    What I have in this copy of index.php is the following:
    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    Did I take the wrong index.php file? It came from the download for my version of WP, which is 3.3.1. I am running it in the Twenty Ten theme.

    What would I change to have it run wordpress as the main site while the site is actually loaded in the subdirectory “”?

    Second, I don’t understand what the instruction says I should be changing to code to. My website/blog is in If I want it to be called up by “”, what should the change be?

    Finally, one of the earlier instructions in the Codex referenced above is to copy .htaccess into the root directory. I’ve done so, but when I open it up to look at it, it is empty. No code, notes, comments – nothing. I understand wordpress may rewrite this when it starts up, but I’m not sure. Should I go ahead with the blank .htaccess?

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


    Forum Moderator

    Now try looking in the index.php file in the WordPress root folder – the same folder that holds your original wp-config.php file.

    Ha, ha! Yep, that was the ticket. It’s exactly as the codex instruction describes it. Thank you! We amateurs have a way of making the simple so complicated.

    OK, so the file reads just as the codex instruction says it would:


    What do I change it to if I want to run it out of “”?

    I’m guessing it’s simply:

    where my wordpress site is in a subfolder of the “public” directory that sits in the root directory on my server.

    Is that correct?



    Forum Moderator

    Try require('./wordpress/wp-blog-header.php');

    Thanks, I tried that.

    It seems conflicting now with my old website.

    I can access the new one through the old url from the test space:

    But when I click on any of the menu bar items, it takes me to pages from the old website at:

    Also, when I go to the WordPress Dashboard and select “Pages”, I can click on edit pages and it takes me to the correct (that is, new) content. But if I click on “view page” it takes me to a page on the old website.

    Do I have to go to my domain management panel and delete something to stop the old site from loading?



    Forum Moderator

    Try renaming your old site’s index.html file.

    OK, I changed it to index.html.old

    Now the site says “under construction” and returns the following message:

    “There doesn’t seem to be a wp-config.php file. I need this before we can get started.

    Need more help? We got it.

    You can create a wp-config.php file through a web interface, but this doesn’t work for all server setups. The safest way is to manually create the file.”

    There’s an instruction at the “we got it” in the message above.

    I had already created a wp-config.php file and put it in the same directory that wordpress resides in. WordPress ran fine in this space at

    Do I need to put a wp-config.php file in my root directory as well, given that WordPress is located in, and I’m trying to run it as

    Or maybe I would be better off moving my wordpress directory up one level so it is one of the directories that shows up in the root directory?



    Forum Moderator

    Try adding DirectoryIndex index.php index.html index.htm to the top of your root .htaccess file.

    Are those separate lines? Just like this?




    Forum Moderator

    No – all on one line – exactly as I entered it above.

    Bingo! That did it!

    Thank you very much! Everything is working fine now.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Moving Site to Root Directory While WordPress is in subdirectory’ is closed to new replies.