If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Getting Rid of File Extensions

Hello.
I've noticed on web pages, such as Google Images, that their URL has no file extensions so instead of the url being 'www.google.com\images.html'
it is 'www.google.com\images' , there is no extension. I would like to no how I can have this sort of URL so I can have 'home' instead of 'home.html' etc.
Thank You!

The complicated way would be to create an own directory for each page and put the page as index.html in there, i. e. for an about page create a sub directory called “about” and the about page would be index.html inside that directory.

The easy way is called “pretty URL” and can be done by modifying the server config, usually with an .htaccess file (if permitted/supported). You know what you have to search for now.

funny thing. my apache2 (nothing special - standard build from ubuntu repo) actually came with this out-of-box.
works for *.html, *.htm and *.php

---edit---

i figured out what's going on.
it's caused by mod_negotiation.
basicaly if it's enabled it will try to guess mime type of document if you won't provide suffix and if file exists it will be server instead of 404 document.
if this module is installed, you can enable it in .htaccess