Forum Moderators: open

Message Too Old, No Replies

Redirect visitor from a specific search engine?

         

acutrician

3:26 pm on Oct 15, 2014 (gmt 0)

10+ Year Member



Is there a script that would detect the type of SEARCH ENGINE a visitor used to come to a site, and depending on the type, deploy a particular action?

If a visitor came to the site after using search engine A, or B, they would be able to browse the site normally, however if they used search engine C, they would be redirected to another web page.

Is there a way to do this?

Fotiman

3:47 pm on Oct 15, 2014 (gmt 0)

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



That sounds like a terrible, terrible idea that would likely get you penalized by search engines. With that said, you could probably look at the document.referrer to determine where they came from, and redirect accordingly. I'm not sure why you'd want to do that, but technically it's probably possible. Don't be surprised, though, if the site stops showing up in ALL search engines.

acutrician

4:01 pm on Oct 15, 2014 (gmt 0)

10+ Year Member



I'm not at all concerned about the consequences - just interested if this were possible, what script to use.

Samizdata

4:36 pm on Oct 15, 2014 (gmt 0)

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



Is there a way to do this?

There are many ways to do it, of which JavaScript is probably the least reliable.

sounds like a terrible, terrible idea

I prefer to use the term misguided.

See the earlier discussion at: [webmasterworld.com...]

There is no search engine C, only search engine G.

...

acutrician

4:52 pm on Oct 15, 2014 (gmt 0)

10+ Year Member



There are many ways to do it, of which JavaScript is probably the least reliable.

So what would you suggest to be the most reliable way?

There is no search engine C, only search engine G.

Yes I know, but the TOS don't encourage specifics...

not2easy

5:27 pm on Oct 15, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I know from another thread here that you have blocked Google from crawling your site. You can use htaccess if your site is on an Apache server, to send visitors with a specific referrer to another page with:
RewriteCond %{HTTP_REFERER} example\.com 
RewriteRule .* http://www.example.com/page.html [R=XXX,L]

where you replace the referrer with the domain name you want to redirect and edit the second line to add the URL you want them to go to. Where it shows
[R=XXX,L]
you put the server response code that you want to use (301 or 302 usually). This goes in the .htaccess file after your canonical rewrites.
This will also redirect the imitation bots as it does not rely on IP or RDNS, only on the domain shown as referrer which is easily faked.

A note to other readers, this is highly NOT recommended and can kill your site in Google as it is the "Cloaking" that Google describes and warns against using but for a site that doesn't want Google's traffic, it should do the trick.

acutrician

5:52 pm on Oct 15, 2014 (gmt 0)

10+ Year Member



not2easy: I appreciate your suggestion, however I don't have direct access to the htaccess file myself - I have to have my host modify it, which has been a bit of a pain in the past. So before I do, is there anything that would work which I could add myself to my web pages?

not2easy

6:07 pm on Oct 15, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I know nothing, sorry.

lucy24

7:32 pm on Oct 15, 2014 (gmt 0)

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



I don't have direct access to the htaccess file myself - I have to have my host modify it

Change hosts. Really. Being able to edit your own htaccess file (or equivalent in That Other Server) is one of the absolute minimum requirements for acceptable shared hosting.

I can't imagine why you would want to do this in javascript when it can be done before the request ever loads up a page. Yes, changing hosts is a better alternative.

Actions based on the referer are easy to do. Probably #3 in frequency after request-based and UA-based actions. I've got one myself where people coming in from search engines in one specific region asking for one specific page will get redirected to a different page. It's a malicious joke based on what they were expecting to find (but wouldn't have found) on the first page. Har, har.

Samizdata

7:47 pm on Oct 15, 2014 (gmt 0)

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



I don't have direct access to the htaccess file myself - I have to have my host modify it

I would suggest that you change your host as a matter of urgency.

...