how do I remove the index.html behind the domain name?


houhouvk

Recommended Posts

Let's say the domain in question is example.com.

As Brian said, you need to have an index page such as index.html (you can have other suffixes, as appropriate - .shtml, .php, etc.).
This should go in your public_html directory.

Then if a visitor simply goes to http://example.com, he will see that address in his browser,
while what is displayed is the contents of index.html.  You don't have to do anything to remove it.

A visitor can also explicitly open http://example.com/index.html
in which case that full address will appear in the browser address bar.

If you want to make that appear as just http://example.com as well,
you can, since the main page for HawkHost's website does exactly that. 

If you try to open https://hawkhost.com/index.php what you see
is just https://hawkhost.com (Index.html gives a 404 error in that instance.)

For some htaccess code to accomplish that, see this post:
https://florianjacob.de/forward_indexhtml_to_dir_with_nginx_and_apache.html
(among many others of simiar bent)

NOTE: adding rewrite rules is tricky business, and can easily mess things up.
Experiment in a subdirectory before adding it to your main home directory.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...