How to test for < and > characters

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 1
Joined: 30 Sep 2012, 18:33

How to test for < and > characters

30 Sep 2012, 18:36

Hi, I have searched high and low on how to do this. I need to test the uri and query string for the "<" and ">" characters and can't seem to do this. Right now I have:

RewriteCond %{QUERY_STRING} (?:\<) [NC]
RewriteRule .? - [F]
RewriteCond %{REQUEST_URI} (?:\<) [NC]
RewriteRule .? - [F]

Thanks for any help,
frank

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: How to test for < and > characters

01 Oct 2012, 02:39

Hello,

I was able to make the following work:

Code: Select all
RewriteEngine on
RewriteRule ^test>a$ - [G]


this throws me GONE with no issues when requesting "/test>a". However you may look for some extra info regarding flags NE,NU here.

Regards
Andrew

User avatar
Posts: 8
Joined: 23 Oct 2012, 23:06

Re: How to test for < and > characters

25 Oct 2012, 23:10

Okay. Thanks a lot, Andrew.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 8 guests