Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to redirect all traffic from a certain referring URL to a specific page?

share|improve this question
up vote 1 down vote accepted

Yes, from a technical point of view, it is possible to examine the referrer URL and issue a redirect if it matches.

Whoever is linking into your site may not like this. Presumably, they want their users to see some of your content and have linked to where they think is appropriate. You could certainly do this to correct their mistake or broken link. I wouldn't do this for traffic from a search engine though.

share|improve this answer
Thanks, it an advertiser that linked to the wrong page (homepage instead of specific landing page) – Daveth3Cat Aug 16 '13 at 13:33

You can use RewriteCond %{REMOTE_HOST} or RewriteCond %{REMOTE_ADDR} to set such redirects.

Try something like:

#A.B.C.D is the referrer IP@
RewriteCond %{REMOTE_HOST} ^A\.B\.C\.D
RewriteRule ^(.*)$ http://www.yoursite.com/landingpage.html [NC,L,U,QSA]
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.