Forum Moderators: phranque

Message Too Old, No Replies

Img src rewrite

         

onetry

2:33 pm on Jul 2, 2007 (gmt 0)

10+ Year Member



Scenario:

first page: red-widgets.html
second page: blue-widgets.html

In both pages I have an IMG named "widgets.gif"

I would like to do this:

in red-widgets.html I would write this HTML code:

<img src="red-widget.gif"> without to copy/paste/rename the original image.

So I would like to rewrite for all colours:

blue-widget.gif ---> widgets.gif
black-widget.gif ---> widgets.gif
green-widget.gif ---> widgets.gif

and so on..

Is it possible?

Any help appreciated, regards.

jdMorgan

5:27 pm on Jul 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Assuming you already have other working RewriteRules, it's fairly simple:

RewriteRule -widget\.gif$ /widgets.gif [L]

For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim