Rewrite rules are not working in IE

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 16
Joined: 22 Apr 2015, 18:41

Rewrite rules are not working in IE

18 Feb 2016, 14:34

Hi,

For info security purpose, we want to remove the "<" or ">" from the search query url. So we put these code in the ISAPI_Rewrite 3.0 httpd.conf file.

RewriteCond %{REQUEST_URI} ^(.*SearchResults*.*).*$ [NC]
RewriteCond %{QUERY_STRING} ^.*(?:%3C|%2F|%3E).*$ [NC]
RewriteRule /(.*)\?(.*)query.*$ /$1\?$2query=BadRequest [NC]

However, these code only working for Chrome and Firefox, but not for IE.

How should I modify the code?

Thank you and Regards!

Yeming

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: Rewrite rules are not working in IE

19 Feb 2016, 10:50

Hello.

I suppose because IE is not encoding these characters. You can modify your rule like this:

RewriteCond %{REQUEST_URI} ^(.*SearchResults*.*).*$ [NC]
RewriteCond %{QUERY_STRING} ^.*(?:%3C|%2F|%3E|<|>).*$ [NC]
RewriteRule /(.*)\?(.*)query.*$ /$1\?$2query=BadRequest [NC]

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 13 guests