WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] root index.php problem after moving wordpress OUT/BACK from its own directory (7 posts)

  1. Nick5a1
    Member
    Posted 3 years ago #

    Hi,

    I had wordpress installed at mydomain.com/content and running the entire site, so the site url in settings was mydomain.com.

    I've now renamed the wordpress directory to mydomain.com/wp and made the site URL also mydomain.com/wp. I also updated the mydomain.com/wp/index.php and the mydomain.com/index.php to point to:

    /** Loads the WordPress Environment and Template */
    require('./wp/wp-blog-header.php');
    ?>

    Now for some reason when I try to delete or replace mydomain.com/index.php my site stops working and I cannot access any of the wordpress pages. I'm not sure why this is happening as the site should be running off the index.php in the wordpress directory (mydomain.com/wp) and not the index.php in the root directory that I am editing.

    Does anyone know what might be happening here?

    Thanks very much for any help.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    the index.php in /wp should not point to:

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

    simply

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

    the first version you are telling it to look for a /wp folder in the /wp folder

  4. Nick5a1
    Member
    Posted 3 years ago #

    Hi Rev Voodoo,

    Sorry I probably wasn't clear. I have two versions of index.php. One is in mydomain.com/wp (the original) and uses the line

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

    and not

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

    The other is in the root directory and uses the line:

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

    From my understanding the index.php in the root directory shouldn't be doing anything as I'm pointing the site URL and wordpress installation both to mydomain.com/wp. However when I delete or replace mydomain.com/index.php my site stops working, even though mydomain.com/wp/index.php hasn't been altered and should be working properly.

    I hope that makes sense?

  5. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

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

  6. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    Have you reset your permalinks (and possibly delete/rename .htaccess)?

    Sometimes that can flake out and get in the way

  7. Nick5a1
    Member
    Posted 3 years ago #

    I found the problem, I hadn't updated my htaccess to reflect the new address. Thank you so much for your help.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.