Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x support forum
 Helicon Tech : ISAPI_Rewrite 2.x support forum
Subject Topic: Image Redirect Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Steve2507
Newbie
Newbie


Joined: 15 May 2007
Online Status: Offline
Posts: 19
Posted: 02 February 2010 at 7:41am | IP Logged Quote Steve2507

I don't know if this is possible but here goes:

We have a number of sites which use the same images (products) and the images are all called the product code, e.g. AB123.jpg.

What I would like to do is change the way the image src is on each site so for site 1 it could be product-name-AB123.jpg and on site 2 it could be AB123-product-name.jpg. But the image shown is actually AB123.jpg.

Is this possible and if so how do I do it?

Thanks

Steve

Back to Top View Steve2507's Profile Search for other posts by Steve2507
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 9125
Posted: 02 February 2010 at 8:51am | IP Logged Quote Anton

You may have different httpd.ini files for different sites and have specific rules in each of them.

E.g.
httpd.ini for site1 (requested URL - product-name-AB123.jpg):

[ISAPI_Rewrite]
RewriteRule /product-name-([^-.]+)\.jpg /$1.jpg [I,L]

---------------------
httpd.ini for site2 (requested URL - AB123-product-name.jpg):

[ISAPI_Rewrite]
RewriteRule /([^-.]+)-product-name\.jpg /$1.jpg [I,L]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
Steve2507
Newbie
Newbie


Joined: 15 May 2007
Online Status: Offline
Posts: 19
Posted: 02 February 2010 at 9:14am | IP Logged Quote Steve2507

Fantastic, I've had to adapt it a bit and changed it to

RewriteRule /images/([^/?]+)-([^-.]+)\.jpg /images/$2.jpg [I,L]

and it works perfect.

Thanks for the help.

Steve

Back to Top View Steve2507's Profile Search for other posts by Steve2507
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum