I'm using free hosting with 000webhost.com, for that the default page it loads is default.php. But I've installed WordPress and now WordPress generated index.php as its homepage file.

As an easy solution, I just redirected from default.php to index.php when the page loads using the code:

<meta http-equiv="refresh" content="0; url=http://thigale.com/" />

But can anyone suggest me any other way? Instead of this stupid process?

  • Please explain what you don't like about the current setup. Would you rather do a real redirect rather than an meta refresh? Do you want index.php to become the homepage? – Stephen Ostermiller Jan 11 '14 at 11:56
  • Yes. I want index.php to become my homepage – Sam Jan 11 '14 at 14:00

For servers using Apache as a server you can create a file named .htaccess in the root of the domain with the content:

DirectoryIndex index.php index.html

The Apache server must also have .htaccess enabled. If the .htaccess file already exists you should add the line above to the existing file.

  • It should work for subdomains too? – Sam Jan 11 '14 at 14:15
  • Yes, that will work for subdomains too if you put the setting in the .htaccess file for each subdomain. – Stephen Ostermiller Jan 11 '14 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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