Search code examples
jqueryajaxsearch-enginehttp-status-code-404

Avoid 404 error when using ajax links that pass variables


I am using this (for example)

$('.changeserver').click(function(e)
{
    e.preventDefault();

    quin = $(this).attr('href');

    $('div.caja').css('visibility', 'hidden');
    $('#'+quin).css('visibility', 'visible');

    $('.jdownloader').css('visibility', 'hidden');
    $('#j'+quin).css('visibility', 'visible');


    $('#servers li a').css('color', '#666');
    $(this).css('color', '#bababa');

});

The url where the users click is www.domain.com/putlocker, as there is the e.preventDefault(); the users doesn't get an error, however, when Google crawls the site, it counts all those likes as 404 links because he doesn't care about the e.preventDefault() as he just reads the code.

How can I fix that?


Solution

  • To prevent Googlebot from following an individual link, add the rel="nofollow" attribute to the link itself.

    http://support.google.com/webmasters/bin/answer.py?hl=en&answer=182072

    Change your link to:

    <a href="www.domain.com/putlocker" class="changeserver" rel="nofollow">Change server</a>