Find jobs - Gavin Newsom - Debt Consolidation - Debt Consolidation - Find jobs

PDA

View Full Version : Strip File Extensions


ResaleBroker
Aug 23rd 2004, 6:53 am
I was reading that you can strip file extension using mod_negotiation by setting the multiviews option in your .htaccess file

Is it really that easy?

ResaleBroker
Aug 23rd 2004, 9:19 am
Is there an advantage to using mod_negotiation for this purpose over something like a PHP script?

Owlcroft
Aug 23rd 2004, 4:25 pm
What is the desired goal? The mod does not "strip" file extensions, it allows their omission in the calling URL, but why is that especially wanted?

If a client requests--

http://www.mywonderfuldomain.com/products/bluewidget

--and the appropriate directive is in .htaccess, and there is no file actually named "bluewidget" in the specified subdirectory, the server will deliver whatever file it finds named bluewidget.xxxx (what it does if there are, say, bluewidget.html and bluewidget.jpg is it "chooses the best match to the client's requirements, and returns that document", whatever that means.

(I have no idea what it would do with a call to myscript?parm1=x&parm2=y -- is it "smart" enough to find myscript.php and then pass the training parms? Could be--Apache is smart.)

ResaleBroker
Aug 23rd 2004, 4:45 pm
QUOTE: "You can make your URLs shorter and more abstract by using content negotiation to strip file extensions from your markup and source code. You'll save a few bytes off of each object reference, and migration headaches in the future when you change technologies."

Here is the article (http://66.102.7.104/search?q=cache:OefD42SKtEgJ:www.websiteoptimization.com/speed/tweak/rewrite/+strip+file+extensions+mod_rewrite&hl=en).

Owlcroft
Aug 23rd 2004, 11:13 pm
Chacun a son gout.

ResaleBroker
Aug 24th 2004, 7:10 am
For sites that change technologies I think this is a great idea.

On one of our sites it seemed like every time we made a major upgrade that meant changing technologies. :eek: First it was Pearl, then ASP and now it looks like we are migrating to PHP.

I agree, "chacun a son gout." :)