homepage Welcome to WebmasterWorld Guest from 54.234.2.94
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
client wishing to redirect search engines
is this code right. is it cloaking
nippi




msg:4590497
 10:58 am on Jul 5, 2013 (gmt 0)

Client has wishes to change domains from a .com.au to a .com.

He doesn't wish to 301 the whole domain, he just wants to 301 the domain as far as search engines are concerned and run the site on the two domains.

Will this work?

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteOptions inherit
RewriteCond %{HTTP_REFERER} .*(msn|live|altavista|excite|ask|aol|google|mail|bing|yahoo).*$ [NC]
RewriteRule .* http://www.example.com [R,L]
</IfModule>

Yes, I am aware its been used as malware, in this case its a "legitamate usage.

[edited by: phranque at 10:51 pm (utc) on Jul 5, 2013]
[edit reason] exemplified hostname [/edit]

 

lucy24




msg:4590635
 8:48 pm on Jul 5, 2013 (gmt 0)

#1 What's with IfModule? You've either got mod_rewrite or you haven't. (If you haven't, change hosts yesterday.)

#2 The quoted RewriteRule doesn't create a 301, only a 302.

#3 Since a redirect-- unlike a rewrite-- is visible to the naked eye, "cloaking" may not be the right word. To do it as a concealed rewrite you're talking proxies.

#4 Why bother with any of this stuff? Set up one domain as a mirror of the other. See the various search engines' wmt for information on internationalization and geotargeting. It is perfectly OK to have the same content on different URLs so long as it's clear that you have non-overlapping audiences, for example Australians and non-Australians.

phranque




msg:4590706
 1:16 am on Jul 6, 2013 (gmt 0)

a redirect isn't really cloaking and in this case the redirect is aimed at the referred visitor and not the bot.

Cloaking - Webmaster Tools Help:
http://support.google.com/webmasters/answer/66355 [support.google.com]

however, your method could be viewed by google as Sneaky redirects:
http://support.google.com/webmasters/answer/2721217 [support.google.com]


.*(msn|live|altavista|excite|ask|aol|google|mail|bing|yahoo).*$

there is a lot of unnecessary backtracking going on there.
this would work just as well for your purposes, if you end up using this:
(msn|live|altavista|excite|ask|aol|google|mail|bing|yahoo)

in this case its a "legitamate usage.

perhaps if you described the intention/purpose of your redirect you could be shown a better method.

nippi




msg:4590818
 2:13 pm on Jul 6, 2013 (gmt 0)

The reason to do it, is to have the sites live, but pass are link value from the previous to the old version of the site.

nippi




msg:4590819
 2:14 pm on Jul 6, 2013 (gmt 0)

So in the end?

I am not sure where this ended up.

a. I want to do a conditional 301.
b. I only want to target search engines not people.
c. Its important link value goes from the old to the new domain, though many people will still use the old domain.

Thats why i am doing it this way, and not doing an actual 301

phranque




msg:4590873
 6:31 pm on Jul 6, 2013 (gmt 0)

I only want to target search engines not people.

your proposed ruleset implies you want to redirect based on the Referer header.
do you really want to redirect based on the User-Agent (crawler identifier)?
in that case you are talking about cloaking and you should implement a different plan.

Its important link value goes from the old to the new domain, though many people will still use the old domain.

danger!
i would avoid anything that looks like an attempt to manipulate page rank or to show bots different responses than people.

lucy24




msg:4590882
 8:21 pm on Jul 6, 2013 (gmt 0)

RewriteCond %{HTTP_REFERER} .*(msn|live|altavista|excite|ask|aol|google|mail|bing|yahoo).*$ [NC]

Your fingers typed HTTP_REFERER but I think your brain meant HTTP_USER_AGENT.

It's still too general, though: in particular, it would include any and all googlebot spoofers. And there have got to be human browser add-ons that contain strings like "msn" or "aol".

Non-issue, though, because it isn't the right way to do what you're trying to do. Look up mirroring and geotargeting. You want to tell the search engines "Yes, these two domains are identical-- and they're supposed to be identical."

Edit for "D'oh!" moment:
One of the domain names is .au. The other isn't. The search engines crawl from the US. You don't need to look at UA at all; you can simply redirect by the first part of the visitor's IP.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved