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.
1) Firrst 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:
$redirect[‘path’] = preg_replace(‘|/index.php/$|’, ‘/’, $redirect[‘path’]);
$redirect[‘path’] = preg_replace(‘|/index.php/*?$|’, ‘/’, $redirect[‘path’]);
I have made the same changes in canonical.php and it has resolved the issue.