Here is what I have in my .htaccess file.
RewriteEngine on
RewriteCond %{QUERY_STRING} ^(run=[a-z0-9A-z]{13})$
RewriteRule %{QUERY_STRING} \? [L]
All I am doing is Rewriting the QUERY_STRING for all QUERY_STRING similar to run=4f13665700694 and do nothing. A URL example: http://thinkingmonkey.me/runs/?run=4f13665700694. So, the RewriteCond should Match. But the above does not work.
But, the pattern seemed correct. Since, both preg_match & RewriteRule use PCRE - Perl Compatible Regular Expressions.
I tried it using preg_match.
$subject = "run=4f13665700694";
$pattern = "/^(run=[a-z0-9A-z]{13})$/";
echo preg_match($pattern, $subject);
And as excepted the above will output:
1
i.e. a successful match.
I do not understand why. What am I missing here?
I think it has something to do with the second line. Try changing it to: