I have setup a server with an "ugly" URL of /search.php?q=query+here
that is re-written to a "pretty" URL of /s/query+here
.
I have not redirected the ugly URL to the pretty URL yet so you can visit both pages.
The page simply performs echo
on $_GET['q']
.
Imagine how surprised I was when I saw that the pretty URL displays query+here
while the ugly URL displays query here
.
They're both exactly the same code/page ... what on earth is going on?
Here is my rewrite... nothing too fancy:
location /s/ {
rewrite ^/s/(.+)$ /search.php?q=$1 last;
}
The php processor is also behind a reverse proxy if that matters at all? (I don't see how it could, just trying to provide as much info as possible!)
If I create a variable $q
and assign the string value what+the
and then echo that... both pages display the same what+the
.
So it definitely has something to do with the fact that the URL is being rewritten I should think.