Support » Fixing WordPress » Copy or move index.php?

  • I have an old website done in HTML, inhabiting the root directory. I have created a WordPress version of the site in a subdirectory, and am following the instructions to allow WordPress to power the site’s root.

    In the “Giving WordPress Its Own Directory” document, under the sub-heading “Using a pre-existing subdirectory install”, the direction is given to “Copy (NOT MOVE!)” the index.php and .htaccess files from the WordPress directory to the root directory.

    While researching this process, I came across more than one site that instructed the exact opposite, “move, not copy” the index.php file.

    My question has several parts:

    Could someone please explain the reasoning behind why or why not to copy or move the index.php file from the WP folder to the root?

    The index.php file now in the root needs to be modified to point back to the WP subfolder with require(‘./wordpress/wp-blog-header.php’); If the index.php file is left in the WP subfolder, will it not conflict with the index.php in the root? (I’ve read also about the Silence is Golden version of the index.php file that can be left in the WP subfolder, further confusing the issue of whether or not to move or copy, in the first place)

    If I can do this move successfully, I assume that I will need to do some 301 redirects in the .htaccess file for the old HTML pages. Do I also do this for the old index.html? Can I delete all the old HTML files from the root afterward?

    Thanks so much for any clarification offered.

Viewing 3 replies - 1 through 3 (of 3 total)
  • While researching this process, I came across more than one site that instructed the exact opposite, “move, not copy” the index.php file.

    Then those sites are wrong. Always refer to the wordpress.org Codex.

    If the index.php file is left in the WP subfolder, will it not conflict with the index.php in the root?

    No. I’ve done umpteen of these “moves” and have never had a problem.

    I assume that I will need to do some 301 redirects in the .htaccess file for the old HTML pages.

    Correct.

    Do I also do this for the old index.html?

    On most hosts, that should not be necessary. The only way to know for sure is to navigate to the old index.html file – post move – and see what happens.

    Can I delete all the old HTML files from the root afterward?

    Yes.

    Thread Starter smcrmo

    (@smcrmo)

    I’ve completed the steps from the codex. I then went to Permalinks in the dashboard as recommended, where there now new rewrite rules, which I copied to the root .htaccess file.

    I also put in 301 redirects for the old html pages. However, when I access just the domain itself in a browser, all I get is a blank page. Viewing the source shows a blank page as well.

    It seems as though the Permalinks rewrite rules that I was instructed to manually update the .htaccess file with, are the same rules that were in the index.php file before I modified it according to the codex instructions. Could this be my issue?

    No – that would be correct.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Copy or move index.php?’ is closed to new replies.