Rewrite rules are not working in IE
2 posts
• Page 1 of 1
Rewrite rules are not working in IE
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
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
Re: Rewrite rules are not working in IE
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]
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]
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 13 guests