Report this

What is the reason for this report?

How to display context on the landing URL/Domain ??

Posted on August 27, 2014

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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.