Random results with IIS6

Topics: User Forum
Jan 11, 2007 at 9:40 PM
Hello,

we have installed the IIRF to Windows2003 server (IIS6). I'm not sure if the behaviour I'm going to describe is problem of IIRF or is influenced somehow by environment.

Content of the IIRF .ini we are using is:
RewriteLogLevel 2

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{URL} (/|\.htm|\.php|\.html|/^.*)$ NC
RewriteRule ^/(content/|component/) /index.php L,U

RewriteCond %{URL} (/|\.htm|\.php|\.html|/^.*)$ NC
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /(.*) /index.php L,U

The testing URL was: www.dnetters.com/research-projects.html
Mostly, it is rewritted as expected (see the log output bellow):

Thu Jan 11 00:36:20 2007 - New Url: '/research-projects.html'
Thu Jan 11 00:36:20 2007 - ApplyRules (depth=0)
Thu Jan 11 00:36:20 2007 - Rule 1 : -1 (No match)
Thu Jan 11 00:36:20 2007 - Rule 2 : 2 matches
Thu Jan 11 00:36:20 2007 - EvaluateCondition: checking '/research-projects.html' against pattern '(/|\.htm|\.php|\.html|/^.*)$'
Thu Jan 11 00:36:20 2007 - Cond : 2 (match)
Thu Jan 11 00:36:20 2007 - EvaluateCondition: checking 'C:\Inetpub\wwwroot\dnetters.com\wwwroot\research-projects.html' against pattern '!-f'
Thu Jan 11 00:36:20 2007 - EvaluateCondition: cond->SpecialConditionType= 'f'
Thu Jan 11 00:36:20 2007 - EvaluateCondition: checking 'C:\Inetpub\wwwroot\dnetters.com\wwwroot\research-projects.html' against pattern '!-d'
Thu Jan 11 00:36:20 2007 - EvaluateCondition: cond->SpecialConditionType= 'd'
Thu Jan 11 00:36:20 2007 - EvaluateConditionList: TRUE, Rule will apply
Thu Jan 11 00:36:20 2007 - Result (length 10): /index.php
Thu Jan 11 00:36:20 2007 - Last if Match
Thu Jan 11 00:36:20 2007 - ApplyRules: returning 1
Thu Jan 11 00:36:20 2007 - Rewrite Url to: '/index.php'
Thu Jan 11 00:36:20 2007 - HttpFilterProc SFNOTIFYURL_MAP
Thu Jan 11 00:36:20 2007 - HttpFilterProc SFNOTIFYURL_MAP
Thu Jan 11 00:36:20 2007 - HttpFilterProc SFNOTIFYURL_MAP
Thu Jan 11 00:36:20 2007 - HttpFilterProc SFNOTIFYURL_MAP
Thu Jan 11 00:36:20 2007 - HttpFilterProc SFNOTIFYURL_MAP
Thu Jan 11 00:36:20 2007 - HttpFilterProc SFNOTIFYURL_MAP
Thu Jan 11 00:36:20 2007 - HttpFilterProc SFNOTIFYURL_MAP
Thu Jan 11 00:36:22 2007 - HttpFilterProc SFNOTIFYLOG
Thu Jan 11 00:36:29 2007 - HttpFilterProc SFNOTIFYURL_MAP
Thu Jan 11 00:36:29 2007 - HttpFilterProc SFNOTIFYAUTH_COMPLETE
Thu Jan 11 00:36:29 2007 - DoRewrites

but in some case, the exactly same URL (Without any interference to anything, just after clicking few another links or just pressing reload), the rewrite fails. Seems the first condition is evaluated fine, but in the second RewriteCond completely different thing ("images\partnerslogo\wattle\logodeptha.gif" not the original URL "/research-projects.html") is checked and this seems to be the reason why this fails. I have idea how the value can appear there. Please, check the log again:

Thu Jan 11 00:38:02 2007 - New Url: '/research-projects.html'
Thu Jan 11 00:38:02 2007 - ApplyRules (depth=0)
Thu Jan 11 00:38:02 2007 - Rule 1 : -1 (No match)
Thu Jan 11 00:38:02 2007 - Rule 2 : 2 matches
Thu Jan 11 00:38:02 2007 - EvaluateCondition: checking '/research-projects.html' against pattern '(/|\.htm|\.php|\.html|/^.*)$'
Thu Jan 11 00:38:02 2007 - Cond : 2 (match)
Thu Jan 11 00:38:02 2007 - EvaluateCondition: checking 'C:\Inetpub\wwwroot\dnetters.com\wwwroot\images\partnerslogo\wattle\logodeptha.gif' against pattern '!-f'
Thu Jan 11 00:38:02 2007 - EvaluateCondition: cond->SpecialConditionType= 'f'
Thu Jan 11 00:38:02 2007 - EvaluateConditionList: FALSE, Rule does not apply
Thu Jan 11 00:38:02 2007 - ApplyRules: returning 0
Thu Jan 11 00:38:02 2007 - No Rewrite
Thu Jan 11 00:38:02 2007 - HttpFilterProc SFNOTIFYLOG
Thu Jan 11 00:38:13 2007 - DllMain THREAD_DETACH, threadId= 4284
Thu Jan 11 00:38:13 2007 - DllMain THREAD_DETACH, threadId= 5340
Thu Jan 11 00:38:13 2007 - DllMain THREAD_DETACH, threadId= 5784
Thu Jan 11 00:38:13 2007 - DllMain THREAD_DETACH, threadId= 2880
Thu Jan 11 00:38:13 2007 - DllMain THREAD_DETACH, threadId= 904
Thu Jan 11 00:38:13 2007 - DllMain THREAD_DETACH, threadId= 5536
Thu Jan 11 00:38:13 2007 - DllMain THREAD_DETACH, threadId= 3420
Thu Jan 11 00:38:13 2007 - DllMain THREAD_DETACH, threadId= 3104
Thu Jan 11 00:38:34 2007 - DllMain THREAD_DETACH, threadId= 2964
Thu Jan 11 00:39:34 2007 - DllMain THREAD_DETACH, threadId= 820
Thu Jan 11 00:40:14 2007 - DllMain THREAD_DETACH, threadId= 6124
Thu Jan 11 00:40:34 2007 - DllMain THREAD_DETACH, threadId= 5396

Is this an IIRF bug?
Jan 19, 2007 at 7:11 PM
Just thought I'd take a stab at this one...

I don't see an NC flag in the documentation or source. Could that be the source of the problem?
Jan 23, 2007 at 9:22 AM
Hi Artio !

I'm having the same problem actually... and It leads to the frontpage every few clicks or so, which makes it hard to wiggle through a purchasing process for example...

I would have hosted it on a robust Apache but part of our devs don't know anything else than MS products, so we've gotta stick to IIS right now (we'll make it to the mono/apache sooner or later though), and Ionics filter's is the cleanest and easiest to set up

(I bought your VirtueMart SEF extension btw :-) )

I hope this will be figured out.

W2K3R2 / IIS6 / PHP5isapi
Coordinator
Feb 24, 2007 at 2:49 AM
Yes! This is a bug in IIRF.
Can you please test with v1.2.11 and tell me your results ?

The problem is that some of the context from prior requests was being re-used inappropriately. The logic for this was re-worked in v1.2.11 to correct this, I believe.

-Cheeso