Forum Moderators: phranque
Their link:
from www.partnerwebsite.com/somepage.html links to www.mywebsite.com/
I need to redirect that link so anyone from www.partnerwebsite.com/somepage.html will land on www.mywebsite.com/other_directory/specific_page.shtml.
I've played around with a bunch of .htaccess RewriteCond and RewriteRule, but no success. Last attempt was:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^(www\.)?partnerwebsite\.com
RewriteCond %{QUERY_STRING}!.
RewriteRule ^(www\.)?mywebsite\.com$ other_directory/specific_page.shtml [NC,L]
Thanks for any help on this!
JC
How do I do redirect based on a referral?
Their link:
from www.partnerwebsite.com/somepage.html links to www.mywebsite.com/
I don't want them landing on my index page, so I want:
www.partnerwebsite.com/somepage.html links to www.mywebsite.com/
and redirected (using .htaccess) to www.mywebsite.com/somedirectory/somepage.html
Suggestions on .htaccess coding to do this?
RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://(www\.)?partnerwebsite\.com
RewriteRule ^$ /other_directory/specific_page.shtml [L]
There is no need to check the QUERY_STRING, since your problem description does not mention it.
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim