WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Moving Site to Root Directory While WordPress is in subdirectory (12 posts)

  1. Wicketty Wabbit
    Member
    Posted 2 years ago #

    I have a site in test right now at http://www.knowlan.com/wordpress, with my blog integrated into it. I like the way it all functions.

    Now I want to have it take over my domain - http://www.knowlan.com as the main site.

    I read the document "Giving WordPress Its Own Directory" here:

    http://codex.wordpress.org/User:Ipstenu/Giving_WordPress_Its_Own_Directory

    It says "If you already have WordPress installed in its own folder (i.e. http://example.com/wordpress) 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:
    require('./wp-blog-header.php');
    to the following, using your directory name for the WordPress core files:
    require('./wordpress/wp-blog-header.php');
    =======================

    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 "knowlan.com/wordpress"?

    Second, I don't understand what the instruction says I should be changing to code to. My website/blog is in knowlan.com/wordpress. If I want it to be called up by "knowlan.com", 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?

  2. esmi
    Forum Moderator
    Posted 2 years ago #

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

  3. Wicketty Wabbit
    Member
    Posted 2 years ago #

    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:

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

    What do I change it to if I want to run it out of "knowlan.com/wordpress"?

    I'm guessing it's simply:
    require('./wordpress/wp-blog-header.php');

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

    Is that correct?

  4. esmi
    Forum Moderator
    Posted 2 years ago #

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

  5. Wicketty Wabbit
    Member
    Posted 2 years ago #

    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:

    http://knowlan.com/wordpress/

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

    http://knowlan.com

    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?

  6. esmi
    Forum Moderator
    Posted 2 years ago #

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

  7. Wicketty Wabbit
    Member
    Posted 2 years ago #

    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.

  8. Wicketty Wabbit
    Member
    Posted 2 years ago #

    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 knowlan.com/wordpress.

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

    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?

  9. esmi
    Forum Moderator
    Posted 2 years ago #

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

  10. Wicketty Wabbit
    Member
    Posted 2 years ago #

    Are those separate lines? Just like this?

    DirectoryIndex
    index.php
    index.html
    index.htm

  11. esmi
    Forum Moderator
    Posted 2 years ago #

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

  12. Wicketty Wabbit
    Member
    Posted 2 years ago #

    Bingo! That did it!

    Thank you very much! Everything is working fine now.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.