Reputation: 1546
I have this code in my htaccess to redirect people who try to access any url that contains query string "username=richard".
RewriteCond %{QUERY_STRING} (^|&)username=richard(&|$)
RewriteRule .* /? [R,L]
The above code works great if someone enter:
example.com/folder.php?username=richard
But i found that it's not working if someone enter upper case in the string value:
example.com/folder.php?username=Richard
or
example.com/folder.php?username=riChard
and etc..
So how to solve the upper/lower cases problem?
Upvotes: 0
Views: 742
Reputation: 4440
add No case flag:
RewriteCond %{QUERY_STRING} (^|&)username=richard(&|$) [NC]
RewriteRule .* /? [R,L]
Upvotes: 2