.htaccess rewrite clashing with $_GET parameters
So, integrating this third party tracking service that passes a $_GET parameter to our product pages. The page is rewritten in .htaccess and they pass the query string starting with a question mark (?) and $_GET doesn't pick it up unless its an ampersand (&).
So this is the htaccess rewrite.
RewriteRule ^the-url/(.*?)/(.*?)/?$ /the-page.php?slug=$1/$2 [L]
This works
http://www.site.com/the-url/someones-name/a-title&something=4
This does not (but I need it to. Notice the question mark rather than ampersand)
开发者_如何学JAVAhttp://www.site.com/the-url/someones-name/a-title?something=4
Thanks
I guess you have to use the [QSA]
flag:
RewriteRule ^the-url/(.*?)/(.*?)/?$ /the-page.php?slug=$1/$2 [L,QSA]
If this flag is set, the given query string will be appended (QSA = Query-String Append), not removed.
精彩评论