I am developing a web application using PHP and I am using Apache’s mod_rewrite for having “friendly” urls.
I have friendly urls like:
mysite.com/article/112
mysite.com/article/145
mysite.com/article/40
Everything is ok but I want to be able to receive extra parameters like this
mysite.com/article/112?referer=google
Actually if I navigate to mysite.com/article/112?referer=google I can see my page but I don’t have the “referer” param in $_GET.
How can I address this?;)
Edit
Solved 😀
I forgot to mention that my old rule was:
Rewriterule ^article/([0-9]+)$ index.php?page=article&article_id=$1
and the new one is:
Rewriterule ^article/([0-9]+)$ index.php?page=article&article_id=$1 [QSA]
add [QSA] modifier to your rewrite rule
means Query String Append -exactly what you want.