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:

www.mysite.com/index.html

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:

www.mysite.com/products/

instead of this:

www.mysite.com/products/coffee.html

How can I do this?

Mac,

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.

Regards,

DK

Thanks DK,

I will read your mod_rewrite tutorial :slight_smile: