views:

33

answers:

2

I have this url:

 http://www.mydomain.com/index.html

And want a rule to rewrite the above into this:

 http://www.mydomain.com

In other words, remove the index.html part of the code...

Something like this maybe:

  RewriteRule ^$ index.html [NC]

Thanks

UPDATE:

When you type www.domain.com into the browser, offcourse index.html is opened. But when you click on "home" on the menu on my website, the entire full url is displayed, which I want to avoid. So when hitting "home" www.domain.com/index.html is shown... But not when entering www.domain.com in the adress bar, then only that will show, but index.html comes up anyways.

So yes, I need this:

www.domain.com/

Not this:

www.domain.com/index.html

Thanks

+1  A: 

I think its like this:

RewriteRule ^index.html$ / [NC]

Replace "index.html" with "/", not "" with "index.html"

opatut
Thanks it works now
Camran
+1  A: 

To redirect requests for /index.html to /

RewriteRule ^index.html$ http://www.mydomain.com/ [R=301,L]
Sjon