anandll
By:
anandll

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

August 27, 2014 1.4k views

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

3 Answers

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 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

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 !! :)

Have another answer? Share your knowledge.