The problem: I cannot figure out how to match a literal dot in my expression so I could rewrite query strings containing dots. First I tried something like this:
RewriteRule ^([\.\w]+)$ index.php?url=$1 [L]
I have a php script:
echo "url is: ".$_GET['url'];
which should, in theory, output anything that I write in my query. But for any query containing only letters and dots, my script always outputs:
url is: index.php
I’ve tried these expressions as well:
^(.+)$
^([.\w]+)$
And the result is the same.
So the question is: are my expressions wrong or does this have something to do with server’s config?
It looks like there is another request which is processed before the rule is applied, if I use a rule which matches less than
index.php(e.g...for matchingxy), the result is as expected:xy. With more relaxing rules like.*or.+it fails.x.*works fine however.You can add another condition to ignore requests like
index.php:This was tested/ debugged with: