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
Using $ GET after a rewrite.?
Moderator: General Moderators
did you try adding a new line below it?
But isn't the hole point of rewriting urls to make them clean and not have to show the get variables?
Code: Select all
RewriteRule product-(.*)\.html$ /product.php?id=$1 [L]
RewriteRule product-(.*)\.html?ad=(.*)$ /product.php?id=$1&ad=$2 [L]
# (.*) matches anything
# RewriteRule product-([0-9]+)\.html$ /product.php?id=$1 [L]
# RewriteRule product-([0-9]+)\.html?ad=([a-zA-Z]+)$ /product.php?id=$1&ad=$2 [L]-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg