I want, for example, https://www.mypage.com to land on the page https://www.mypage.com/index.html, show the contents of https://www.mypage.com/index.html, but on the browser I want to see https://www.mypage.com
I’m using apache web server
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I’m sure you just described the default behaviour of most web servers. Apache and nginx will look for an index.html or htm file by default when you load a directory. When you browse to domain.com you are (if you don’t have any redirects) requesting the root web directory. If your web server is configured to look for index.html index.htm (like I said, they are by default) they it’ll load it, if it exists, and you won’t need to do anything else.
Are you seeing different behaviour?
Hi,
Just wanted to share that finally we managed to resolve this problem thanks to brilliance from my colleague who hit the right target…
Apparently, there is a setting on the httpd.conf as below … After setting DirectoryIndex to disabled, this has worked perfectly…
**=================== #DirectoryIndex index.html index.html.var
DirectoryIndex disabled ===================**
Thanks a lot for the help !! :)
Hi Mark,
You are right… Our webserver was configured to redirect the URL to land on index.html, which as you say, IS the default behaviour… I’ve removed this redirection and see that the URL gets redirected to index.html from my DocumentRoot… However, the URL still shows http://mypage.com/index.html instead of http://mypage.com
How do I still hide index.html
I also saw a link http://stackoverflow.com/questions/8019889/mod-rewrite-how-to-hide-index-html
RewriteEngine on RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.index.html\ HTTP/ RewriteRule ^(.)index.html$ /$1 [R=301,L]
Will this resolve the issue??? Thanks again
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.