How To Carry My Base URL info after a Rewrite Occurs?

Topics: Developer Forum, User Forum
Jan 25, 2011 at 5:11 PM

ISSUE: when i issue my rewrite server side this works GREAT however  i loose the constructs of my base URLs within the newly rewritten page making all links  within rewritten page to be broken.  and therefor not serving up intended content.   My websites uses a base URL reference of  -Once i get into the rewritten page all the links within the page are no longer equiped with the required  /scripts/cgiip.exe/WService=xyz/   THIS is needed to make the dynamic pages fire off and serve backend 'productINFO'.  I am sure this is a conditoin of IIS not IIRF  (cause and effect)-  Does anyone know of a work around-

thanks i can provide IIRF logs and such if necessary-    

Jan 31, 2011 at 1:23 PM

solution:  don't rewrite the URLs you don't want to rewrite.

Check your rules, examine the IIRF log.  Tweak the rules to eliminate rewrites on URLs that should not be rewritten.


Jan 31, 2011 at 5:36 PM

Cheeso- OK hope you got my other email direct to you. Thank you

From: Cheeso [email removed]
Sent: Monday, January 31, 2011 8:23 AM
Subject: Re: How To Carry My Base URL info after a Rewrite Occurs? [IIRF:243236]

From: Cheeso

solution: don't rewrite the URLs you don't want to rewrite.

Check your rules, examine the IIRF log. Tweak the rules to eliminate rewrites on URLs that should not be rewritten.

Feb 2, 2011 at 2:29 PM

Hmm I don't check that email very often.  If you have questions on IIRF, then this is the best place to ask and answer them!

Feb 3, 2011 at 8:53 PM
Edited Feb 3, 2011 at 9:16 PM


Can you Please assist on this issue- as i see it i have obvious lack of knowlege with Regex and with the use of IIRF.  (I know two strikes)  I need to get something running pretty quickly.  Like i said i have given to your favorite charity and will do so again.  All i need to do is get a few things figured out on how to make my rewritten pages not change all of my pages links-   

 I set up your IIRF rewrite code on my IIS6.0 . Than within my .ini file i  rewrote two pages;  basically i took . and shortened it with  and  it works as i would have expected GREAT. 

HOWEVER what i was not ready for was every link i click on after landing on the rewritten page is now a dead link.  This is because it would appear the rewitten page is now shortening all of my URLs within this page.  For example once i click on the link within the rewritten page i get a this type of shortened link   THIS does not work for me.. the link should look  like this.    as you can see the rewritten page is no longer equiped with the  /scripts/cgiip.exe/Wservice=XYZ/  So my delemma is to get this placed back into the links unless i experssively ask it to be rewritten.  .  I know you have tons of your time poured into this product and your trade in general- so i am more than willing to compensate thru donation to your favorite charity. 



Feb 5, 2011 at 3:13 AM

I don't know what you mean by  "How to Carry my base URL  info etc etc".

Normally in cases like yours you need a rewrite rule that deals with all the shortened links your page may include.

So you need to have a rule that rewrites from  /editquanities.w    back to the full (server internal) URL, of /scripts/cgiip.exe/Wserivice=XYZ/editquanities.w  

just as you have a rule that rewrites the original.

Feb 8, 2011 at 9:13 PM

I was not wanting to have to rewrite every single link into my iirf.ini file in order to keep the website functioning; I was hoping you could help me find some all encompasing regex statement to make these links work. 

 ok i am going to clearup what i mean by not carrying my 'base' url  if you go to  you will see this works fine based on this rewrite rule            RewriteRule clearance$   /scripts/cgiip.exe/WService=fq/prodbrws.html?lvl=9 [L]

WELL if you click on the product on the right..  you will see it directs you to my '/' root home page as do all links on this newly rewritten page.

So upon your post above, I created this rule 

RewriteRule   itemdetl.html?item=Leg_Magic_Ultra$  /scripts/cgiip.exe/WService=fq/itemdetl.html?item=Leg_Magic_Ultra [L]

This does not work whether I type it in manally at broswer bar?   I assume their is a rule or something being broken; My log does not appear to throw any errors. i am using log level 3. 


Feb 10, 2011 at 2:05 PM

I'm sorry, I'm not able to understand the situation you're describing.

What I recommend is that you use Fiddler2, as well as the IIRF log and in some cases the IIS log to examine the traffic and figure out what you want to do.  Then use tools like the Regex tool and the TestDriver.exe program to develop your rules and insure they work like you expect. This approach is explained in the IIRF documentation.


Feb 10, 2011 at 4:27 PM

WOW.. i do not know how to be any more clear.  i've provided links and so fourtht to  a live site. i thought with a few clicks you would be more enlightened to how the site is functioining after the page is rewritten, upon which you could give me some more direct pointers..  compare surfing  to

i think you will see the rewritten page using /clearance  breaks the rest of the links contained in this page.. (compare).

OK i will wrestle with it some more, thank you for your suggestions and thanks you for your time.