Cloaking with Coldfusion

Discussion in 'Programming' started by j0ned, Nov 28, 2006.

  1. #1
    Could you just use an if statement to check for the user agent?

    
    <cfif #CGI.HTTP_USER_AGENT# EQ "Googlebot/2.1 (+http://www.google.com/bot.html)" or #CFI.HTTP_USER_AGENT# EQ "Mozilla/5.0 (compatible; googlebot/2.1; +http://www.google.com/bot.html)">
    
    display this data
    
    <cfelse>
    
    display this data
    
    </cfif>
    
    Code (markup):
    or would it be better to use a list of IP's? If so - how would you go about checking the REMOTE_ADDR against a list of IPs in a txt file, or MySQL table?
     
    j0ned, Nov 28, 2006 IP
  2. seamus.hogan

    seamus.hogan Peon

    Messages:
    31
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That would work but you would quickly end up with a very clunky if statement.

    Using query to check would be better

    <cfquery name="checkIP" datasource="#sourcename#">
    SELECT IP
    FROM IPTABLE
    WHERE IP = #CGI.REMOTE_ADDR#
    </cfquery>

    <cfif checkIP.recordcount GT 0>
    Do this because IP address is in the table
    <cfelse>
    Do this because IP address is not in the table
    </cfif>

    Personally I think it would be a bad idea to do this because I'm pretty sure that google could send out bots that spoof the user agent and pretend to be from a regular user and then run a comparison with an unspoofed bot. You may well find yourself banished from their listing doing that sort of thing.
     
    seamus.hogan, Nov 29, 2006 IP
  3. j0ned

    j0ned Active Member

    Messages:
    684
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    60
    #3
    You're right - so what's all the hype about? How do people avoid being caught? I'm not sure why people even cloak at all.. Show the bots unique/manually written content, then show users scraped/duped content??

    I've read a lot about it here in the forums, but don't completly understand *why* it's done (other than to trick index bots). How do webmasters gain or benefit from using this??
     
    j0ned, Nov 29, 2006 IP
  4. seamus.hogan

    seamus.hogan Peon

    Messages:
    31
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    In the old days it was relatively easy to cheat the bots and get an artificially high rating in the search engines. This meant that the search results became poor quality and people migrated to the search engines that weeded out the irrelevant sites.

    Don't do it BMW did and this happened
    http://news.bbc.co.uk/1/hi/technology/4685750.stm

    Rather that cloak make proper use of <title> <h1> <h2> <h3> etc tags and make good copy that is readable by searchengines and people.

    hope this helps.

    Seamus
     
    seamus.hogan, Dec 11, 2006 IP
  5. j0ned

    j0ned Active Member

    Messages:
    684
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    60
    #5
    Thanks - My gut told me to stay away from cloacking, and I'm glad I listened. And about making use of <title> <h1> <h2> <h3>, etc.. Would you mind looking at http://teen-health.jruck.com and provide any suggestions as to how I could make the page easier to read by humans & search engine bots? Or if the use of these tags is already up to par?

    Thanks again for the info!
     
    j0ned, Dec 12, 2006 IP
  6. seamus.hogan

    seamus.hogan Peon

    Messages:
    31
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hi,

    to my eye that looks pretty good, but things can always be improved :)

    Maybe try wrapping the health articles in an <H> tag because the titles are all pretty relevant and they are acting as a heading on the page so tell google that they are headings.

    After that just work on building lots of quality inbound links and that is just time and patience.

    Hope this helps.
     
    seamus.hogan, Dec 19, 2006 IP
  7. forumposters

    forumposters Peon

    Messages:
    270
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #7
    What exactly does Google not like about cloaking? Is there a way to cloak that does not break any rules and would be OK with Google even if they knew exactly what you were doing in your code? How have others here done this with Coldfusion? What other code snippets can you share please?
     
    forumposters, Apr 3, 2007 IP