Forum Moderators: open

Message Too Old, No Replies

Image without .gif / .png type declaration

generated by cgi

         

maggi

10:00 am on Feb 18, 2004 (gmt 0)

10+ Year Member



I have give-away-images for afiliated partners.
These are genererated by a script
and I would like to use mod_rewrite to shorten the parameter string and to extend the image type ending.
Currently the images are generated as .png images,
but I would like to use the .gif Format and generate animated gif's when the license restriction are gone.

Question:
In order to give to my afiliated partners a parameter string working now on png and later on gif,
I would like to use a string without the image type:
<img src="parameter_string_111_222">
mod_rewrite will deliver the image, but is that supported by all browsers?
Thanks, Maggi

tedster

6:18 am on Feb 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wow, maggi, that is an adventurous question. My first thought is that you would need to use a path to the cgi-bin for the src= attribute - a path that includes the parameter in a query string, rather than just using the parameter.

This is not something I've ever tried, however. Perhaps we'll get some other input.

tombola

8:59 am on Feb 19, 2004 (gmt 0)

10+ Year Member



I use content negotiation, so all my pages can be accessed without a filename extension.
This works for .html, .cgi, .php, .gif, .jpg etc.

This can be done with only one line in your .htaccess file:
Options ExecCGI MultiViews

maggi

10:13 am on Feb 19, 2004 (gmt 0)

10+ Year Member



Thank you for the hint to look on the server side.
So its not a matter of the browser?
When
[mydomain...] is called
and
[mydomain...] is delivered
and the browser does not care about the change?
Thanks, Maggi

tombola

10:50 am on Feb 19, 2004 (gmt 0)

10+ Year Member



With content negotiation, your server checks only the filename (without extension), so you cannot use two identical filenames in the same directory (mypage.html and mypage.gif are considered identical names).

In order to use content negotiation properly, you must consistently address all references to your pages, images, programs without filename extensions.
If you link to a page within your site, never use the filename extension:
instead of <a href="anotherpage.html">, use <a href="anotherpage">.

Content negotiation works great and if you ever consider switching from .png to .gif, you must do nothing, as your server will automatically use the filename without extension. :-)