I’m trying to write a rewrite rule but I’ve some serious problems with forwarding query string.
I also tried [QSA] flag but it didn’t work.
Following the correct request:
/localhost/registry/registry.php?id=something&password=somethingelse&uri=whatever
And I would change into something like this:
/localhost/registry/register
with the same post query (id=something&password=somethingelse&uri=whatever).
At this point, my .htaccess would modify the above request in the following one:
/localhost/registry/registry.php?request=register&id=something&password=somethingelse&uri=whatever
Then, I tried the following rewrite rule in my .htaccess:
RewriteRule ^register$ http://localhost/registry/registry.php?request=$0&$1 [QSA]
But, after the last ‘&’, nothing is showed and the $1 variable is empty.
What kind of rewrite rule I have to write?
Thanks in advance.
!!! SOLUTION !!!
RewriteRule ^register$ /registry/registry.php?request=$0 [QSA]
if you go to
http://localhost/registry/register?id=1, then query string would be(from php) :