Rewrite rule without regular expression

Topics: User Forum
Jan 4, 2011 at 11:28 AM

Hello, I use an older version of Ionic Isapi filter. I am using it by this way:

RewriteRule ^/en/bratislava           /go/clanky/29.asp?lang=en
RewriteRule ^/en/bratislava-silvester         /go/clanky/27.asp?lang=en

My problem is: The second rewriterule sends user to the same page like the first rewriterule. It looks the filter takes only the word bratislava and does not care what is behind hyphen. By which way I can get the result that the second rewriterule sends user to the 27.asp page and not to the 29.asp page?

I consider to install Ionic Isapi filter 2.0 which is available for our host. Would it work then?

Many thanks.

Jan 4, 2011 at 8:51 PM

The first rule matches a URL like /en/bratislava-silvester.  If you want to only match /en/bratislava , then you should include the "end of string" assertion, which is a $ character, in the regex.


RewriteRule ^/en/bratislava$             /go/clanky/29.asp?lang=en
RewriteRule ^/en/bratislava-silvester$   /go/clanky/27.asp?lang=en

You won't need a new version of IIRF for this.

Jan 4, 2011 at 9:25 PM

Many thanks for fast reply. It works. I would like come back ASAP.

Jan 4, 2011 at 11:28 PM

If you have many of those RewriteRules, then you may consider updating to IIRF v2.1.1.23, which includes the RewriteMap directive.  The RewriteMap can simplify the mapping of static strings to other URLs, as you seem to be doing. Check the documentation for more information.