- Code: Select all
RewriteRule ^test/([^/]+)/$ test.php?q=$1 [QSA,NC,L]
and test.php is just this:
- Code: Select all
foreach ($_GET as $key => $val) {
print "{" . $key . "} = {" . $val . "}<br>\n";
}
So if I go to the following URL:
- Code: Select all
http://www.site.com/test/this+&+that/
I get the following output:
- Code: Select all
{q} = {this }
{that} = {}
The ampersand in there has been missenterpreted by the Apache so it thinks that we want to use the following URL:
- Code: Select all
test.php?q=this+&+that
But exactly the same happens if I substitute '&' for '%26'.
What I want to happen is to get a URL where 'q' is 'this & that' or more explicitly:
- Code: Select all
test.php?q=this+%26+that
Is there a way to do this?