I am trying to write a rule in .htaccess to rewrite search requests containing Korean characters to a 404 page.
RewriteEngine On
RewriteCond %{QUERY_STRING} [\x{ac00}-\x{d7a3}]
RewriteRule ^(.*)$ /404.html [R=404,L]
When testing I get the message that the reqexp failed to execute.
When testing the same regex with preg_match in php it works.
if (preg_match('/[\x{ac00}-\x{d7a3}]/u', $string)) {
echo "URL contains korean charachters";
}
Any advice?