Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide index.php (or index.html) of an URL

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.

like image 843
Philippe Carriere Avatar asked Aug 17 '09 15:08

Philippe Carriere


People also ask

How do I remove Index php from the URL?

To remove the “index. php” from your site's URLs, you will first need to make sure your server is set up to pass would-be 404 requests off to Craft's index. php file behind the scenes. If you're running Apache, you can do that by creating a redirect in your site's .

How do I remove .html from URL?

html extension can be easily removed by editing the . htaccess file.

IS IT index html or index html?

Default Homepage The index. html page is the most common name used for the default page shown on a website if no other page is specified when a visitor requests the site. In other words, index. html is the name used for the homepage of the website.


1 Answers

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.

like image 61
Thinker Avatar answered Nov 04 '22 22:11

Thinker