Forum Moderators: phranque

Message Too Old, No Replies

Using $ GET after a rewrite.?

Using $_GET after a rewrite to record a google var

         

dave_c00

8:46 am on Jul 18, 2007 (gmt 0)

10+ Year Member



Hi,

I am using RewriteRule to sort out my urls in htaccess. The problem is that now I need to record a $_GET that is on the end of the url when it comes from a google ad.

example:

/product-1-widget.html (is my normal url which works fine)
/product-1-widget.html?ad=google (is the new url that I want to get $_GET['ad'] from but because I am already rewriting it doesnt work)

I currently use this RewriteRule line:

RewriteRule product-(.*)\.html$ /product.php?id=$1 [L]

Thanks

Dave

jdMorgan

2:02 pm on Jul 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Add the [QSA] flag -- Query String Append, to append your new "id=" parameter to the existing "ad=" parameter.

This would make the flags on the end of your rule read "[QSA,L]".

Jim