1

For a while now I have been redirecting my index.php page to homepage.php for the sake of my home page actually having homepage as the filename.
A disadvantage I am seeing in Google Search Console with getting my website indexed is that it does not seem to like redirects.
I just thought I would throw the question out to you and see what difference, if any it makes as to how you name your homepage.

1

Is there any advantage to naming the home page: homepage.php?

Short answer? No.

There is absolutely no advantage to a file named homepage.

Index.html is the default for any home page and indeed any page not specified. For example, going to example.com would result in example.com/index.html by default.

Depending upon your web server configuration, index.php may also be a default. If you are using Apache, for example, this would be true. With Apache, the site configuration file would have a directive similar to the following.

DirectoryIndex index.html index.htm index.php index.php4 index.php5

This directive is listing the default files in order. For example, if index.html is not found, then Apache will try index.htm. If index.htm is not found then Apache will try index.php and so on until the list is exhausted.

If in your root directory there is an index.html, I would rename it to something like x-index.html. Same for index.htm if it exists. You could rename your homepage.php to index.php so that when going to example.com it would result in example.com/index.php. Lastly, remove the redirect from index.php to homepage.php.

If you take these steps, you will see 404 errors for homepage.php in your error log files or in Google Analytics. This is perfectly normal and nothing to worry about. If you are using Googles Search Console, you can use the URL Inspection Tool to Fetch your new index.php. In time, your home page will be the index.php. This could be quick or take a few weeks. In time, you will likely see better results overall.

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.