View Single Post
Old 03-07-2011, 06:42 PM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,235
Quote:
Originally Posted by Jakez View Post
Let's say I am receiving traffic from a URL with various ID #'s attached to it:
http://www.referrer.com/?id=101

Andthe traffic is going to:
http://www.site.com

How do I have the .htaccess grab the ID from the referrer and do a quick redirect or something so that it will send the visitor to this instead:
http://www.site.com/?ref_id=101
Code:
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?referrer\.com/ [NC]
RewriteCond %{QUERY_STRING} ^id=([^&]+)$
RewriteRule ^(.*) http://site.com/?ref_id=%1 [L]
this should work.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote