Hide page name & extension in address bar

How can I hide my page name and extension in the address bar?

For example when I click on my “Home” link, it would take me to:


but instead I’d like it show in the address bar without the page name and extension, like this:

I also like to apply this to other directories, like for example if I click on the link “Coffee”, the address bar will look like this:


instead of this:


How can I do this?


For the lack of file specified, you should just use the absolute URL for your link. As for converting products/ to products/coffee.html, that’s ONLY possible if coffee.html is the DirectoryIndex (default file) for products/. Otherwise, Apache has no way of guessing what file in the directory you want served.

Have a read of the mod_rewrite tutorial linked in my signature for more information. THEN, if that’s what you want, come back with a “specification” and I’ll help you through it.



Thanks DK,

I will read your mod_rewrite tutorial :slight_smile: