Redirecting to http if the Request_URI contains a paramater

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 33
Joined: 18 Jul 2012, 07:50

Redirecting to http if the Request_URI contains a paramater

21 Jan 2016, 06:40

If am trying to redirect the page to http if the request_uri contains a parameter named 'test'

My rules look like

RewriteCond %{HTTP:Host} (.*)
RewriteCond %{REQUEST_URI} (.*)
RewriteCond %{REQUEST_URI} (?test)
RewriteCond %{HTTPS} on
RewriteRule .? http://%1%2 [R,L]

but some how it's not working.

any idea

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

Re: Redirecting to http if the Request_URI contains a parama

25 Jan 2016, 09:17

Hello.

You need NC flag for RewriteCond:

RewriteCond %{HTTP:Host} (.*)
RewriteCond %{REQUEST_URI} (.*)
RewriteCond %{QUERY_STRING} test [NC]
RewriteCond %{HTTPS} on [NC]
RewriteRule .? http://%1%2 [R,L]

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 4 guests