Ad

Hide Index.php (or Index.html) Of An URL

- 1 answer

When I type the address of my site in a browser (mysite.com), it redirects to mysite.com/index.php. Why not to index.html ? Because I changed it in the conf file in Apache 2.2 .

  • Now I would like to hide the last "index.php" part. How do I do that ?
  • Would it be different it was index.html than index.php ?

Wouldn't be ugly if by looking for google, you would end up on www.google.com/index.html ? ... it's just for esthetics but god is it important to certain people.

Ad

Answer

I don't know why you need to use mod_rewrite. On my site I did nothing to hide index.php, I just don't point it anywhere in code, so instead of www.example.com/index.php?task=forum I just write www.example.com/?task=forum. It works on standard apache config.

Ad
source: stackoverflow.com
Ad