Forum Moderators: phranque

Message Too Old, No Replies

Redirect users to a specific page coming from a specific site.

Redirect users to a specific page coming from a specific site.

         

chetanmadaan

4:33 am on May 19, 2011 (gmt 0)

10+ Year Member



I know there is a way we can give users a 403 or 404 error if they are coming through a bad site... but is there a way we can redirect them to a special page of our own site if they are coming through a specific site.

the case here is actually different... we are running a promotion on our products and we know the websites which are sending traffic to our homepage...


all we want to do is specifically redirect users coming from a specific http_reffer website.

any tips?

wilderness

4:59 am on May 19, 2011 (gmt 0)

chetanmadaan

5:22 am on May 19, 2011 (gmt 0)

10+ Year Member



I am sorry... i don't really follow you! is this something which can do the job.

once again i am not a htaccess pro.

lucy24

7:28 am on May 19, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



RewriteCond %{HTTP_REFERER} action=view&member=lucy24$
RewriteRule \.html$ dp/wmw.html

:: snicker ::

You don't have to spell out the full address of the referrer, just enough to identify it unambiguously. Use ^ and $ if necessary.

g1smd

10:14 am on May 19, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The above code needs the [L] flag.

Referrer isn't a completely reliable way to detect the user. It may be missing if the user's ISP has all their customers behind a caching proxy (such as AOL and EarthLink) or if the user has Internet Secrity Software (which strips such data from the HTTP request) on their PC.

You should have a separate landing page set up for visits coming from the other site, and it should have
meta robots noindex
tag to keep it out of the SERPs.

Additionally, you could add a query string parameter to the link and detect that when a visitor arrives (and then issue a 301 redirect to the canonical URL).

[edited by: engine at 8:08 am (utc) on May 20, 2011]

chetanmadaan

2:41 pm on May 19, 2011 (gmt 0)

10+ Year Member



thanks for the directions sir.. Appreciate that.

FYI! i found this one... [javascriptkit.com...] and modified the second line to send a redirect instead of a 403.

Thanks

wilderness

3:25 pm on May 19, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



FWIW, and along the lines of what lucy was attempting to explain?

Your not required to use the complete refer, rather any of the following anchors:
1) begins with
2) ends with
3) contains
4) exactly as

In lucy's example, you could even use portions in the application of contains:

RewriteCond %{HTTP_REFERER} action [OR]
RewriteCond %{HTTP_REFERER} lucy

or; you could combine the "terms" on a single line:
RewriteCond %{HTTP_REFERER} (action|lucy)


And as the caution that g1smd supplied, "refers are certainly not 100% applicable", however

they will function.

chetanmadaan

7:18 pm on May 19, 2011 (gmt 0)

10+ Year Member



this one worked.

[webmasterworld.com...]