But this question is slightly different.
Say I have a RewriteRule like:
RewriteRule ^test/([\w]*)/([\w]*)/([\w]*)/?$ go.php?q=THREE_$1_$2_$3
So http://localhost/test/a/b/c gets rewritten to http://localhost/go.php?q=THREE_a_b_c
Now say I want to explicitly catch the condition where the middle parameter is left out and a double slash results, like http://localhost/test/a//c
So I write a rule like:
RewriteRule ^test/([\w]*)//([\w]*)/?$ go.php?q=TWO_$1_(EMPTY)_$2
BUT ALAS, the rule never matches, it seems RewriteRule does not see the double slash, even though the double slash is preserved in both %{THE_REQUEST}
and %{REQUEST_URI}
.
So I write a rule like:
RewriteCond %{REQUEST_URI} //
RewriteRule ^test/([\w]*)/([\w]*)/?$ go.php?q=TWO_$1_(NONE)_$2
And that works, because the RewriteCond only applies if there's a double slash in the REQUEST_URI. But as you can see I still have to assume there's NO double slash there when parsing with the regex.
All this is very disturbing because I thought RewriteRule worked on %{REQUEST_URI} but it turns out it doesn't, it works on something else (a double slash stripped version..?)
My question really is, if not raw %{REQUEST_URI} then what does RewriteRule feed on?