Forum Moderators: phranque

Message Too Old, No Replies

Can apache do this ?

         

deepakd

6:03 pm on Mar 22, 2010 (gmt 0)

10+ Year Member



here is the problem I am trying to solve:

Apache 2.2 acting as a static image server only.
Now, I have images stored in file system in two formats: with and without extension.
My clients would ask for images with or without extension for example:: http//giveme.com/image or http//giveme.com/image.png

How can apache successfully serve images in this scenario ?

encyclo

7:37 pm on Mar 22, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Apache's content negotiation module will handle this scenario for you.

g1smd

7:48 pm on Mar 22, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I always thought that files in the server would need an extension so that the server would know how to handle them, but you can map any URL format request you like to those files.

jdMorgan

11:52 am on Mar 23, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you don't want to have problems with generating correct HTTP Content-Type headers, then all *files* on the server must have extensions.

But because URLs and filepaths are not at all the same thing, URLs do not need to have extensions -- As g1smd says, the server can map any URL to any file you like, either directly, or through content-negotiation (MultiViews) or mod_rewrite.

Jim