Support » Fixing WordPress » root index.php problem after moving wordpress OUT/BACK from its own directory

  • Resolved Nick5a1

    (@nick5a1)


    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.

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

    (@esmi)

    Forum Moderator

    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

    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?

    esmi

    (@esmi)

    Forum Moderator

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

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

    Sometimes that can flake out and get in the way

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘root index.php problem after moving wordpress OUT/BACK from its own directory’ is closed to new replies.