Every time I try and visit the index.php file on my website, it automatically redirects me to an index.html page. I have no redirects in .htaccess. My wordpress site is in a subdomain, but it redirects me to the main domain every time. How can I get rid of this redirect?

  • It would be helpful if you included more information about your problem, we aren't all psychic. :) Could you describe your root directory? and the path of your domain? I suspect it's probably an incorrectly configured domain path.
    – Lewis
    Commented Feb 16, 2019 at 14:10
  • Sorry I’m quite new to Wordpress. The Wordpress site is stored in a subdomain (projects.donnellysurveyors.com), and the main website is donnellysurveyors.com/index.php. I have no idea why it redirects to donnellysurveyors.com/index.html, which is outside of the subdomain. Hopefully this is enough info ! Thanks.
    – 0jd9
    Commented Feb 17, 2019 at 15:05
  • So, to clarify when you visit projects.donnellysurveyors.com it redirects you to donnellysurveyors.com/index.php? If so there are a couple of reasons this may be happening. Firstly, Check that your subdomain isn't pointing to donnellysurveyors.com. (Remember to clear your broswer cache when making changes cmd/ctrl + refresh > Hard Reload.) Secondly, check that your phpmyadmin is pointing to the correct site domain url. If your unsure on this your hosting provider might be able to help. Let me know how you get on.
    – Lewis
    Commented Feb 17, 2019 at 15:30
  • 1
    Thanks for the reply. I tried all of the above, and it finally worked. I think a few links in phpMyAdmin were wrong. Thanks again.
    – 0jd9
    Commented Feb 18, 2019 at 20:19

1 Answer 1


"Redirect" from index.php to index.html might be caused by your apache settings. If you have index.html before index.php in your apache config file and you have both of these files in your folder, it will go for the index.html.

Try to add this to your .htaccess file (index.php preferred over index.html)

DirectoryIndex index.php index.html

or change it in your apache config file. On Mac:

sudo nano /etc/apache2/httpd.conf

and look for DirectoryIndex.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.