1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Strip File Extensions

Discussion in 'Apache' started by ResaleBroker, Aug 23, 2004.

  1. #1
    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 23, 2004 IP
  2. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #2
    Is there an advantage to using mod_negotiation for this purpose over something like a PHP script?
     
    ResaleBroker, Aug 23, 2004 IP
  3. Owlcroft

    Owlcroft Peon

    Messages:
    645
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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.)
     
    Owlcroft, Aug 23, 2004 IP
  4. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #4
    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.
     
    ResaleBroker, Aug 23, 2004 IP
  5. Owlcroft

    Owlcroft Peon

    Messages:
    645
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Chacun a son gout.
     
    Owlcroft, Aug 23, 2004 IP
  6. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #6
    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." :)
     
    ResaleBroker, Aug 24, 2004 IP