1

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 greatly appreciated!!!!

PaperChase
  • 1,557
  • 4
  • 18
  • 23

1 Answers1

2

This should do the job:

RewriteRule ^site/(.*)$ retailertest3.php?linklabel=$1&%{QUERY_STRING}
simbo
  • 374
  • 4
  • 6
  • 1
    I simply added [QSA] to the rule and it worked: RewriteRule ^site/(.*)$ retailertest3.php?linklabel=$1 [QSA] – PaperChase Sep 23 '11 at 22:38