WordPress redirects index.html page to index.php
-
Hi, Problem Summary:
I have uploaded both index.php and index.html pages on my blog. When I visit my-site.com I go to my-site.com/index.html which is correct according to the page priority which we have setup for default docuemnts. But when I visit my-site.com/index.php I always go to my-site.com/index.html which should not be happened.Possible Solutions:
1) First have a check with the .htaccess file for the index page rules and set the correct rules for index files. Make sure that there is no redirect rule set for index.php.
2) Please have a check with the canonical settings from wp-includes/canonical.php file. And replace the code as mentioned:Original Code:
// $original[‘path’] = preg_replace(‘|/index\.php$|’, ‘/’, $original[‘path’]);Replace With:
$original[‘path’] = preg_replace(‘|/index\.php/*?$|’, ‘/’, $original[‘path’]);I have made the same changes in canonical.php and it has resolved the issue.
That’s it!
- The topic ‘WordPress redirects index.html page to index.php’ is closed to new replies.