Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: Image URLs Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
davew
Newbie
Newbie


Joined: 07 August 2008
Online Status: Offline
Posts: 5
Posted: 07 August 2008 at 10:31am | IP Logged Quote davew

I'm just new to isapi_rewrite.

Does anyone know if there is a RewriteRule that can be written to prevent all image paths being changed by my Rewrite rules? Basically I am rewriting alot of URLs for my application with Rules like

RewriteMap deptmap txt:rewrite\depts.map

RewriteRule ^shop/list/([BC]{1})/([\&_a-zA-Z'-]*)(/?)$ /products.asp?lvl1_id=${deptmap:shop}&lvl2_id=${deptmap:$2}}&category=$1 [NC, QSA, L]

However my images aren't displaying

I know I can go back and change all my image paths in the application to use root relative paths and/or use the html <base> tag but I'm I was hoping for a quick and easy fix without having to go back through all my pages

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


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4676
Posted: 08 August 2008 at 3:33am | IP Logged Quote Anton

Please try to add the following condition before your rule:

RewriteCond {REQUEST_URI} !^.*\.(?:gif|jpg|png)$ [NC]

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


Joined: 07 August 2008
Online Status: Offline
Posts: 5
Posted: 08 August 2008 at 4:42am | IP Logged Quote davew

Thanks for the reply but unfortunately it has not worked for me. I put the condition before every rule (at the moment I have 5 rules). My images are .jpg files.

What is this condition doing? And is it correct to put it in front of every rule?

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


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4676
Posted: 11 August 2008 at 9:05am | IP Logged Quote Anton

And where do your images now reside?
Probably you have changed site structure but did not change the links on pages?


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


Joined: 07 August 2008
Online Status: Offline
Posts: 5
Posted: 12 August 2008 at 3:15am | IP Logged Quote davew

My images are in the same location as they were before I started any rewrite rules in a folder called images.

In my pages <img src="image/123.jpg" /> worked before my rules. With the rules in place it won't display.

If I change the path to <img src="/shop/images/123.jpg" /> where shop is the root folder of the site then it works fine.

 

 

 

 

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

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 can vote in polls in this forum