PDA

View Full Version : Extensions



viktor
10-14-2006, 12:34 AM
How do I get rid of page extensions?

Like when I click on a page on my site it shows up in address bar as
www.site.com/example.html
How do I make it show up as www.site.com/example

thanks,
viktor



Real Art Photography...where reality meets light. (http://www.realartphotography.com/)

mburt
10-14-2006, 12:36 AM
Make a folder called "example" and want you want to appear, will be called "index.html" in that folder.

viktor
10-14-2006, 12:41 AM
thanx

mwinter
10-14-2006, 01:12 AM
Make a folder called "example" and want you want to appear, will be called "index.html" in that folder.

In that event, the URI would be

  http://www.example.com/example/

If the OP is intending to remove "extensions" on all files (or at least among some significant subset), then using directories isn't practical.

I've mentioned two techniques (http://www.dynamicdrive.com/forums/showpost.php?p=49006&postcount=7) in the past. A third is to use URL rewriting (on supporting servers), but that has only limited use as it can become difficult to determine which suffix should be applied when there are several to choose from. A fourth is type maps - another content negotiation mechanism. It doesn't produce extension-less URIs, but it does produce extension-neutral URIs by using a single form (typically .var, but any one will do).

Mike