ignoring folder doesn't seem to work

Topics: User Forum
Oct 25, 2009 at 10:16 PM
Edited Oct 26, 2009 at 4:29 AM

I have created the following rule:


RewriteRule ^/(/store/$)   -        [I,L]


which I thought would force IIRF to ignore any following rules. However, when I go to the page https://www.domain.com/store/(other variables) the system redirects me to http://www.domain.com//store/(other variables).

Notice the addition of the extra / before /store and the removal of the secure channel.

If I create a blank rule file everything processes normally so it is being caused by IIRF and not by our code.



Oct 25, 2009 at 11:22 PM
Edited Oct 25, 2009 at 11:23 PM

Your rule is probably not doing what you think it is doing . 

RewriteRule ^/(/store/$)   -        [I,L]

What this says is, if the URL is //store/, then don't rewrite, and don't process any other rules.  The ^ is a zero-width assertion meaning "beginning-of-line".  Then you have a slash, and an open paren.  The paren is also zero-width - it just says that you want to capture whatever matches.  Then another slash, the word store, and another slash.  The $ is a zero-width assertion meaning "end-of-line".  So the URL must be //store/ in order to match.   This probably doesn't match most requests.  If the URL request is /store/category/6, then it won't match.  If the URL is /store, it won't match.  If it is //store/anything, it won't match.  It will match only if it is //store/ . Is that what you expect?

You should consider using the testdriver.exe to check your rules against the incoming URL requests you expect.

That tool is documented.

With it, you'll be able to put together a set of URLs, and what you expect them to be rewritten to., and then run those URLs through the set of rules.  Then the tool checks the actual output versus the expected output.  You can then tweak the rules until you get the results you expect.



Oct 26, 2009 at 4:29 AM

Thanks I got it working.