How to set up htaccess rewrite for multiple variables?
I originally created SEO friendly links for my site. I wanted my links for my coupon code site to look like:
http://www.mydomain.com/site/bodybuilding.com
So I did a rewrite in the htaccess that worked:
RewriteRule ^site/(.*)$ retailertest3.php?linklabel=$1
Now, I'm working on creating a custom affiliate program. I want users to be able to send traffic to a link like:
http://www.mydomain.com/site/bodybuilding.com?ref=john
How would I go about modifying the rewriterule so that the ref variable is passed properly to retailertest3.php?
Also, after I get the value of the ref variable and do some stuff with it, is it possible to do a 301 redirect back to the original URL of:
http://www.mydomain.com/site/bodybuilding.com
I'm trying to avoid possible canonical issues like this, as well as keep everything looking clean.
Any help is greatly appreciated!!!!!
Any help is greatl开发者_StackOverflowy appreciated!!!!
This should do the job:
RewriteRule ^site/(.*)$ retailertest3.php?linklabel=$1&%{QUERY_STRING}
精彩评论