regex - Apache redirect if string contains anything other than letters and numbers -
so have rewrite condition, takes %1
previous line, , should redirect if string contains other letters , numbers. but, reason, works if string begins , ends letters or numbers (allowing middle anything)
heres condition:
rewritecond %1 !^[a-z0-9]+ [nc] rewriterule ^ http://www.example.com/nomatch
so, in case, wont redirect if %1
hdsuf38//*&hdsfghj73
anyone know i'm missing?
two changes
add small letters character sequence.
add anchor
$
matching continued till end of string
regex can be
^[a-za-z0-9]+$
rule as
rewritecond %1 !^[a-za-z0-9]+$ [nc] rewriterule ^ http://www.example.com/nomatch
Comments
Post a Comment