Forum Moderators: open

Message Too Old, No Replies

Googlebot smartphone crawl desktop URL 302

The 302 status code accounts for nearly half of the total

         

Jean23894

7:05 am on Jun 16, 2023 (gmt 0)



I'm optimizing a large website. (www and m, 2 versions) There are some questions after switching to mobile-first indexing.
1. The proportion of 302 status codes is gradually increasing and is currently close to half. All are caused by Googlebot Smartphone crawling the desktop URL. But not for Googlebot Desktop.
2. cache: www.example.com(desktop). The result it returns is the mobile content.

I don't have any experience with this before, so I'm pretty confused. Can someone answer these two questions?

not2easy

12:00 pm on Jun 16, 2023 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Hi Jean23894 and welcome to WebmasterWorld [webmasterworld.com]

A 302 server response indicates a temporary redirect from one URL to another. If you need to relocate content to a different URL for a time, a 302 tells crawlers that the move is only for a short time and can prevent indexing its temporary URL.

If you have separate URLs for desktop and mobile versions of a site, you should submit different sitemaps for each version. Are you detecting the UA to serve mobile content or allowing a choice by the user? There should be no need to see 302 responses unless you know the reason for them. If you are seeing desktop results for mobile URLs, it may not be clear to Google that there are separate URLs.

If the site requires two versions rather than using the same URLs for mobile and desktop and adjusting layout with CSS you should submit two separate sitemaps to tell Google which URLs are for mobile users.

Google explains it here: [developers.google.com...]

lucy24

5:16 pm on Jun 16, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



To put it slightly differently: A 302 isn't Google. It's you. Only you can figure out whether it is intentional or not. There are two parts to the question: Do you want the request to be redirected (probably yes, since you say there are separate URLs for desktop and mobile), and do you want the said redirect to be temporary or permanent?

When you code a redirect--in your config file, htaccess or whatever applies to your server situation--the default tends to be 302 Temporary. You have to explicitly say if you want it to be permanent. For example, in Apache, [R] means 302 Temporary while [R=301] means 301 Permanent.

In most situations, you'll want a redirect to be permanent. Among other things, human browsers will remember a 301 response and will go straight there the next time you request the old URL, but if it's a 302 they will continue requesting the original URL.

You don't say how long the two sites have existed in parallel. If G keeps getting a 302 response for a long time, they will eventually decide it's really a 301 ... but their computer will also mutter to itself about “poor technical quality”, since it is in the site's power to decide what response to send.

Jean23894

2:07 am on Jun 19, 2023 (gmt 0)



If the site requires two versions rather than using the same URLs for mobile and desktop and adjusting layout with CSS you should submit two separate sitemaps to tell Google which URLs are for mobile users.


To put it slightly differently: A 302 isn't Google. It's you. Only you can figure out whether it is intentional or not. There are two parts to the question: Do you want the request to be redirected (probably yes, since you say there are separate URLs for desktop and mobile), and do you want the said redirect to be temporary or permanent?


Thanks very much. I think I didn't make the difference between desktop and mobile versions clear. Actually, only their URL is different, content is not too much different. Maybe mobile content is a little less. I only submitted the desktop sitemap for the canonical desktop URL.

I have set and checked Canonical and Alternate tags following Google instructions.

And I know from the techs that they do some setup. If a Googlebot smartphone visits our desktop site, it will 302 redirect to mobile. That seems right. Should I also set one up from mobile to desktop for Googlebot Desktop?

not2easy

4:38 am on Jun 19, 2023 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



The question about content was whether the mobile URLs used a separate CSS file to resize the content, not whether the content was different. When the content is the same on both desktop and mobile, the majority of sites just create a responsive layout and use one URL to serve both desktop and mobile sites. You can keep two separate versions, but then you need two sitemaps. Both sitemaps should be found in the main directory and linked in your robots.txt file.

A 302 is a temporary change of URL so if you want your mobile pages/URLs indexed your redirect should not be temporary. The permanent URL for Mobile is the URL you want to have indexed for your mobile sitemap so it should be a 301 rather than a 302 response. You should submit two separate sitemaps to help with having both versions indexed. Using a 302 and not submitting both sitemaps is likely the reason Google is showing the mobile content for desktop. As lucy24 explained, if Google keeps getting a 302 response for a long time, they will eventually decide it's really a 301. That means that only the mobile URLs may be indexed. That is the reason for submitting two sitemaps and when redirecting to mobile it should be a 301.

tangor

5:25 am on Jun 19, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I didn't make the difference between desktop and mobile versions clear. Actually, only their URL is different, content is not too much different.


If the difference in content is that small why not make it suitable for both by using a full responsive web design so the CONTENT can appear in either viewport size?

At that time all redirects should (must) become 301, g (or other search engines) have only one set of site data to deal with, and all canonicals will operate properly regardless of device.

lucy24

6:38 am on Jun 19, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Actually, only their URL is different, content is not too much different.
This is ambiguous, because “content” means two different things. On the one hand is the words and pictures--the material a human user sees on their screen. But on the other hand is the page layout, styling, all the details of html and css.

In general, the googlebot should receive the same response a human receives. If the human is redirected, so should Google be. Anything else, and you risk being suspected of “cloaking”.

Personal example: I have a handful of pages in one directory on one site that initially serve a 302 to smartphone visitors because reasons. It's 302 rather than 301 because it’s an “Are you sure you want this page?” type of redirect: if they re-request it, they get the “real” page. So it has to be a 302, because if it were a 301 the browser would send them right back to the “detour” page.

As a necessary consequence, mobile Googlebot also receives this 302, although in their case they'll never take the action that would let them see the “real” page. This is probably exasperating for everyone--but in the case I describe, all pages, both “real” and “detour”, are noindexed, so it ultimately makes no difference.

I just checked logs. In the last 18 months, a page from this directory has been requested precisely once by the non-mobile Googlebot. They got the page, and promptly gobbled up all its associated scripts--no biggie, because all scripts are noindexed--but it doesn't seem to have occurred to them to try the other pages with the non-mobile Googlebot.

Jean23894

3:14 am on Jun 20, 2023 (gmt 0)



If the difference in content is that small why not make it suitable for both by using a full responsive web design so the CONTENT can appear in either viewport size?


Our website has just been refactored for more than a year, and due to technical limitations, responsive design cannot be done.

The question about content was whether the mobile URLs used a separate CSS file to resize the content, not whether the content was different. When the content is the same on both desktop and mobile, the majority of sites just create a responsive layout and use one URL to serve both desktop and mobile sites.


This is ambiguous, because “content” means two different things. On the one hand is the words and pictures--the material a human user sees on their screen. But on the other hand is the page layout, styling, all the details of html and css.


Thanks all. I understand the content you mentioned here. The desktop layout differs from the mobile layout, including HTML, CSS files, etc. The text content and images of the two terminals are almost the same.

You can keep two separate versions, but then you need two sitemaps. Both sitemaps should be found in the main directory and linked in your robots.txt file.


I see that Google does not recommend submitting a mobile sitemap. If a mobile sitemap is submitted, will the mobile and desktop rank separately? Are mobile urls still an alternate url for desktop?

not2easy

1:20 pm on Jun 20, 2023 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I went back to that link I posted above because Google changes their recommendations from time to time. According to the current best practices, Google will only be indexing your mobile URLs - but they strongly suggest that the content be the same on both versions of a page or it can cost in ranking. You can, but don't need to submit both sitemaps, it is recommended when content is not identical.