I have so many 302 error in my Google Search Console.

I changed HTTP to HTTPS recently and confusing part in Google Search Console is when I check there's /search.php on the end of every URL. It seems the error comes from that, and every hour I can see more errors - something is causing /ssearch.php to be added every URL in my website, which doesn't make sense:

enter image description here

  • 302 isn't an error code, it's an HTTP response status code which tells search engines and clients that the resource has "moved temporarily". Your web server or server-side application may be configured to redirect files ending in "search.php" using a 302. Therefore I'd suggest checking your server's config files (e.g., .htaccess) or server application for related code (i.e., you should see "302" in the code). From there you might be able to determine what its purpose was, and if you want to change that to something else (like a 410 "gone"). – dan Aug 10 at 3:48

Those 302 indicate that your pages are redirected. When you switch from HTTP to HTTPS, that is what you want. You want your site from HTTP to HTTPS you want visitors and search engine bots to get redirected to the HTTPS site.

There is no need to remove any of these codes from that report in Google Search Console. When Google reports that it finds hundreds of redirects, you only need to do something if you are not expecting those pages to redirect.

You should change those redirects from "302 temporary" redirects to "301 permanent" redirects. Once you make the change to HTTPS, you shouldn't ever have to go back. Semantically, "permanent" makes more sense. 301 redirects are better for SEO because search engines pass link juice across them more reliably. 302 redirects have the potential to cause ranking problems associated with this protocol change. 301 redirects are also better cached by browsers. Users that type your domain name into their browsers regularly will get a faster experience with 301 redirects. Their browser won't need to contact your server each time.

I'm not sure exactly how you implemented the redirects. You'll need to figure out how to change them to permanent redirects. The two most common ways are with a rewrite rule and with a Apache redirect directive. With a rewrite rule, you would change RewriteRule ... [R] to RewriteRule ... [R=301]. With a redirect directive you would change redirect / https://... to redirect permanent / https://....

The other thing that you should do is add your https://example.com/ property to Google Search Console. Your http:// property isn't going to show meaningful data from now on. Search analytics will now move over to the HTTPS property. Index and crawl reports will be more meaninful on the HTTPS property. You'll need to resubmit any sitemaps you may have submitted to the HTTPS property version.

You can keep both the HTTP search console property around. It isn't hurting anything. You could also consider adding www. and no-www variants. I recommend adding four properties for most sites. All the combinations of http, https, www, and no-www.

The root of your problem is probably a link on every page using the relative URL "Search.php". That link will cause those many URLs with Search.php added to the end of them.

Your system seems to try and cope with this mistake by doing a 302 redirect. I'm guessing it's a bad destination as they are being reported as "Not followed". This could indicate something like a redirect loop.

Fix the root cause, e.g. change "Search.php" links to "/Search.php".

And fix how the mistake is redirected. I suggest they should also 301 redirect to "/Search.php"

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.