A
A
Alexander2014-12-30 03:02:59
Google Webmaster Tools
Alexander, 2014-12-30 03:02:59

Why does Google Webmaster complain about redirects?

The interfaces have buttons (links) for switching listing sortings. They lead to the following addresses:
site.com/ru/?sort=price
site.com/ru/?sort=rating
And at the beginning of the page there is this simple piece:

if(isset($_GET['sort'])){
  setcookie("sort", $_GET['sort'], time()+315360000, "/"); // на 10 лет..
  header("location:".$_SERVER['HTTP_REFERER']);
}

Google Webmaster Tools scolds this:
"Googlebot found a redirect operator on the page, but the operator does not contain a link to any of the pages, so Googlebot was unable to follow the redirect. Make sure none of the redirect operators are empty. Each of them must contain the address of an existing page."
"...If the site constantly redirects from one page to another, make sure that the correct HTTP status code is returned (301 Permanently moved)..."
Tell me how to do it right?
Thank you!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question