Same config file, upgraded IIRF, old rule won't work

Topics: User Forum
Feb 22, 2011 at 7:57 PM

I'm moving my website to a new server, and the tech guys have installed the latest version of IIRF for me. Everything seems to work like it did before, except for one rule:

RewriteRule  (.*)%7E(.*) $1~$2 [I]

This rule was necessary because our ecommerce system uses tildes (~) extensively in the URLs, and a lot of HTML editors would mangle them to become %7E. This worked fine for several years on the 1.X version of IIRF; now that I've got 2.1 running, this one rule doesn't seem to work anymore. 

This was designed to transform URLS from this:

http://www.eisenbrauns.com/wconnect/wc.dll?ebGate%7EEIS%7E%7E%7E%7ESPECIAL

to this:

http://www.eisenbrauns.com/wconnect/wc.dll?ebGate~EIS~~~~SPECIAL

Can anyone clue me in as to why this one part will not work anymore???

Thanks!

Andy Kerr
Webmaster
http://www.eisenbrauns.com 

 

My config file:

# log settings
RewriteLog d:\temp\iirf
RewriteLogLevel 2

IterationLimit 20
# The most iterations necessary (so far) have been 12.

# fix tilde escapement
RewriteRule  (.*)%7E(.*) $1~$2 [I]

# trim trailing spaces
RewriteRule (.*)%20$ $1 [I]

# simplified URLs
# Rule 1 assumes that item keys are alphanumeric only.
# Rule 2 assumes that page names are alphanumberic, and may contain an underscore, but not a dash.

RewriteRule (.*)/(item|items|products|books|software)/([A-Za-z0-9_\-]+).*$ $1/wconnect/wc.dll?ebGate~EIS~~I~#U$3#E [I]
RewriteRule (.*)/(page|pages|sale|sales)/([A-Za-z0-9_\-]+).*$ $1/wconnect/wc.dll?ebGate~EIS~~~~#U$3#E [I]

Coordinator
Feb 23, 2011 at 2:48 AM

Hi Andy,

Witht he change to v2.x, IIRF began decoding URLs before testing the regex rules against them.  This means that %7E in an incoming URl should automatically be transformed into a tilde before any of your rules see the URL.  I think this should mean that your one rule that is not working, is unnecessary.

I just tested this here, and I get the behavior that I just described - automatic URL decoding.

If that's not happening for you, I'd like to see your IIRF log file, for a single request.

 

Feb 23, 2011 at 3:11 PM

Auto-decoding? AWESOME. I don't think that's happening for me for some reason, though. OK, looking at the log files, I see that there's "No decoding" going on—I'm guessing that's relevant. (Where do I turn this on...?) Nonetheless, it doesn't work with that rule on OR off. It just passes it on the the eCommerce engine, which ignores the "bad data" end of the URL. The difference in number of files retrieved in each log is probably attributable to caching.

Here's the log with the rule off:

Wed Feb 23 10:15:56 -  3744 - -------------------------------------------------------
Wed Feb 23 10:15:56 -  3744 - Ionic ISAPI Rewriting Filter (IIRF) 2.1.1.23 x86 RELEASE
Wed Feb 23 10:15:56 -  3744 - IIRF was built on: May 30 2010 13:26:57
Wed Feb 23 10:15:56 -  3744 - Cached: DLL_PROCESS_ATTACH
Wed Feb 23 10:15:56 -  3744 - Cached: Process ID: 1888
Wed Feb 23 10:15:56 -  3744 - Cached: ReadServerConfig: C:\Program Files\Ionic Shade\IIRF 2.1\IirfGlobal.ini(23): Filter Priority is now: HIGH (0x80000)
Wed Feb 23 10:15:56 -  3744 - Cached: ReadServerConfig: C:\Program Files\Ionic Shade\IIRF 2.1\IirfGlobal.ini(46): NotifyLog setting is now: OFF
Wed Feb 23 10:15:56 -  3744 - Cached: ReadServerConfig: C:\Program Files\Ionic Shade\IIRF 2.1\IirfGlobal.ini(63): RewriteEngine setting is now: ON
Wed Feb 23 10:15:56 -  3744 - Cached: DLL_PROCESS_ATTACH - complete
Wed Feb 23 10:15:56 -  3744 - Cached: GetFilterVersion
Wed Feb 23 10:15:56 -  3744 - GetLogFile: app:'/LM/W3SVC/1/ROOT'  new log:'f:\temp\iirf.1888.log'
Wed Feb 23 10:15:56 -  3744 - ReadVdirConfig: actual log file 'f:\temp\iirf.1888.log'
Wed Feb 23 10:15:56 -  3744 - ReadVdirConfig: ini file: 'F:\Inetpub\wwwroot\Iirf.ini'
Wed Feb 23 10:15:56 -  3744 - ReadVdirConfig: ini file timestamp: 2011/02/23 10:14:32 Eastern Standard Time
Wed Feb 23 10:15:56 -  3744 - ReadVdirConfig: cfg(0x01235C60)
Wed Feb 23 10:15:56 -  3744 - ReadVdirConfig: LogLevel = 2
Wed Feb 23 10:15:56 -  3744 - ReadVdirConfig: F:\Inetpub\wwwroot\Iirf.ini(13): IterationLimit 20
Wed Feb 23 10:15:56 -  3744 - ReadVdirConfig: F:\Inetpub\wwwroot\Iirf.ini(24): RewriteRule (rule 1)  '(.*)%20$'  '$1'      [I]
Wed Feb 23 10:15:56 -  3744 - ReadVdirConfig: F:\Inetpub\wwwroot\Iirf.ini(31): RewriteRule (rule 2)  '(.*)/(item|items|products|books|software)/([A-Za-z0-9_\-]+).*$'  '$1/wconnect/wc.dll?ebGate~EIS~~I~#U$3#E'      [I]
Wed Feb 23 10:15:56 -  3744 - ReadVdirConfig: F:\Inetpub\wwwroot\Iirf.ini(32): RewriteRule (rule 3)  '(.*)/(page|pages|sale|sales)/([A-Za-z0-9_\-]+).*$'  '$1/wconnect/wc.dll?ebGate~EIS~~~~#U$3#E'      [I]
Wed Feb 23 10:15:56 -  3744 - ReadVdirConfig: Done reading INI for the root vdir, found 3 rules (0 errors, 0 warnings) on 33 lines
Wed Feb 23 10:15:56 -  3744 - DoRewrites: Url (no decoding): '/ECOM/_35N0M009Z.HTM'
Wed Feb 23 10:15:56 -  3744 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  3744 - DoRewrites: Url (no decoding): '/ECOM/eisenstyle2.css'
Wed Feb 23 10:15:56 -  3744 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  3744 - DoRewrites: Url (no decoding): '/ecom/utility.js'
Wed Feb 23 10:15:56 -  3744 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  3744 - DoRewrites: Url (no decoding): '/ECOM/milonic_src.js'
Wed Feb 23 10:15:56 -  3744 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  3744 - DoRewrites: Url (no decoding): '/assets/page-elements/clearpixel.gif'
Wed Feb 23 10:15:56 -  3744 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  3744 - DoRewrites: Url (no decoding): '/assets/redesign_elements/fragment04.gif'
Wed Feb 23 10:15:56 -  3744 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  1776 - DoRewrites: Url (no decoding): '/assets/page-elements/shade-element-5.gif'
Wed Feb 23 10:15:56 -  1776 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  1776 - DoRewrites: Url (no decoding): '/assets/book_images_small/F/FRALANDOF.jpg'
Wed Feb 23 10:15:56 -  1776 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  1776 - DoRewrites: Url (no decoding): '/ECOM/menu_data.js'
Wed Feb 23 10:15:56 -  1776 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  1776 - DoRewrites: Url (no decoding): '/ECOM/mmenudom.js'
Wed Feb 23 10:15:56 -  1776 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  1776 - DoRewrites: Url (no decoding): '/assets/page-elements/shade-element-1.gif'
Wed Feb 23 10:15:56 -  1776 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  1776 - DoRewrites: Url (no decoding): '/assets/page-elements/shade-element-3.gif'
Wed Feb 23 10:15:56 -  1776 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  1776 - DoRewrites: Url (no decoding): '/assets/book_images_small/E/EIDENIGMA.jpg'
Wed Feb 23 10:15:56 -  1776 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  1776 - DoRewrites: Url (no decoding): '/assets/book_images_small/A/ALVELAMAN.jpg'
Wed Feb 23 10:15:56 -  1776 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  3744 - DoRewrites: Url (no decoding): '/assets/misc/rssxml.gif'
Wed Feb 23 10:15:56 -  3744 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  1776 - DoRewrites: Url (no decoding): '/assets/book_images_small/K/KLIBRIDGI.jpg'
Wed Feb 23 10:15:56 -  1776 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  1776 - DoRewrites: Url (no decoding): '/assets/page-elements/arrow-right.gif'
Wed Feb 23 10:15:56 -  1776 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  1776 - DoRewrites: Url (no decoding): '/assets/book_images_small/R/ROBINVENT.jpg'
Wed Feb 23 10:15:56 -  1776 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  3744 - DoRewrites: Url (no decoding): '/assets/catalogs/Covers/2006EAPCover120.jpg'
Wed Feb 23 10:15:56 -  3744 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  3744 - DoRewrites: Url (no decoding): '/assets/iranica/straight_volumes.gif'
Wed Feb 23 10:15:56 -  3744 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  3744 - DoRewrites: Url (no decoding): '/assets/tags/eis_home_page.gif'
Wed Feb 23 10:15:56 -  3744 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  3744 - DoRewrites: Url (no decoding): '/assets/arrow.gif'
Wed Feb 23 10:15:56 -  3744 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  3744 - DoRewrites: Url (no decoding): '/assets/page-elements/shade-element-4.gif'
Wed Feb 23 10:15:56 -  3744 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  3744 - DoRewrites: Url (no decoding): '/assets/page-elements/vertstripe-fade.jpg'
Wed Feb 23 10:15:56 -  3744 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  1776 - DoRewrites: Url (no decoding): '/assets/page-elements/shade-element-2.gif'
Wed Feb 23 10:15:56 -  1776 - DoRewrites: No Rewrite
Wed Feb 23 10:15:56 -  3744 - DoRewrites: Url (no decoding): '/assets/redesign_elements/bg_featured.jpg'
Wed Feb 23 10:15:56 -  3744 - DoRewrites: No Rewrite

And here with the rule on:

Wed Feb 23 10:52:37 -   736 - -------------------------------------------------------
Wed Feb 23 10:52:37 -   736 - Ionic ISAPI Rewriting Filter (IIRF) 2.1.1.23 x86 RELEASE
Wed Feb 23 10:52:37 -   736 - IIRF was built on: May 30 2010 13:26:57
Wed Feb 23 10:52:37 -   736 - Cached: DLL_PROCESS_ATTACH
Wed Feb 23 10:52:37 -   736 - Cached: Process ID: 2588
Wed Feb 23 10:52:37 -   736 - Cached: ReadServerConfig: C:\Program Files\Ionic Shade\IIRF 2.1\IirfGlobal.ini(23): Filter Priority is now: HIGH (0x80000)
Wed Feb 23 10:52:37 -   736 - Cached: ReadServerConfig: C:\Program Files\Ionic Shade\IIRF 2.1\IirfGlobal.ini(46): NotifyLog setting is now: OFF
Wed Feb 23 10:52:37 -   736 - Cached: ReadServerConfig: C:\Program Files\Ionic Shade\IIRF 2.1\IirfGlobal.ini(63): RewriteEngine setting is now: ON
Wed Feb 23 10:52:37 -   736 - Cached: DLL_PROCESS_ATTACH - complete
Wed Feb 23 10:52:37 -   736 - Cached: GetFilterVersion
Wed Feb 23 10:52:37 -   736 - GetLogFile: app:'/LM/W3SVC/1/ROOT'  new log:'f:\temp\iirf.2588.log'
Wed Feb 23 10:52:37 -   736 - ReadVdirConfig: actual log file 'f:\temp\iirf.2588.log'
Wed Feb 23 10:52:37 -   736 - ReadVdirConfig: ini file: 'F:\Inetpub\wwwroot\Iirf.ini'
Wed Feb 23 10:52:37 -   736 - ReadVdirConfig: ini file timestamp: 2011/02/23 10:52:19 Eastern Standard Time
Wed Feb 23 10:52:37 -   736 - ReadVdirConfig: cfg(0x01234A38)
Wed Feb 23 10:52:37 -   736 - ReadVdirConfig: LogLevel = 2
Wed Feb 23 10:52:37 -   736 - ReadVdirConfig: F:\Inetpub\wwwroot\Iirf.ini(13): IterationLimit 20
Wed Feb 23 10:52:37 -   736 - ReadVdirConfig: F:\Inetpub\wwwroot\Iirf.ini(19): RewriteRule (rule 1)  '(.*)%7E(.*)'  '$1~$2'      [I]
Wed Feb 23 10:52:37 -   736 - ReadVdirConfig: F:\Inetpub\wwwroot\Iirf.ini(24): RewriteRule (rule 2)  '(.*)%20$'  '$1'      [I]
Wed Feb 23 10:52:37 -   736 - ReadVdirConfig: F:\Inetpub\wwwroot\Iirf.ini(31): RewriteRule (rule 3)  '(.*)/(item|items|products|books|software)/([A-Za-z0-9_\-]+).*$'  '$1/wconnect/wc.dll?ebGate~EIS~~I~#U$3#E'      [I]
Wed Feb 23 10:52:37 -   736 - ReadVdirConfig: F:\Inetpub\wwwroot\Iirf.ini(32): RewriteRule (rule 4)  '(.*)/(page|pages|sale|sales)/([A-Za-z0-9_\-]+).*$'  '$1/wconnect/wc.dll?ebGate~EIS~~~~#U$3#E'      [I]
Wed Feb 23 10:52:37 -   736 - ReadVdirConfig: Done reading INI for the root vdir, found 4 rules (0 errors, 0 warnings) on 33 lines
Wed Feb 23 10:52:37 -   736 - DoRewrites: Url (no decoding): '/ECOM/_35N0NB9E1.HTM'
Wed Feb 23 10:52:37 -   736 - DoRewrites: No Rewrite

Coordinator
Feb 24, 2011 at 12:44 AM

I cannot recall just now what specifically "(no decoding)" means  in that log message.  I thought it was unclear, and I've since modified the log message in the current version of the source code to be more clear.  It could mean that decoding is OFF.  It could also mean that no decoding was necessary. I'll have to check the older source code to verify.

having said that, The incoming URL does not appear to be in an encoded form.  The /ECOM/_35N0NB9E1.HTM is not URL-encoded, as far as I can tell. 

So, let me take one step back, and ask - what makes you say that the explicit rule you have in your ini for performing decoding of %7E to tilde, is not working.  I see no %7E in the incoming URL.  I also see no tildes. At this point, I don't understand the problem you're trying to solve.  I do see an incoming URL request, and in both cases, it does not match any rule.  So no rewrite is performed.  This is what I would expect to happen, given the rules in your ini file.   I am sure I am misunderstanding something, or missing some information here, but right now I don't see the problem.

You said something about "bad data" on the URL,but I don't know what that means either.