How bad is JS redirects for SEO?

How bad is JS redirects for SEO? - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the How bad is JS redirects for SEO? error on your web browser. Problem :


I have a domain with different markets/languages on different URL paths, like example.com/fr for France and example.com/se for Sweden. This way we gets all our pages indexed for each language - great! But we also have domain.com without suffix which will lead to the site for England, and we cannot change this easily.



We want to force our users to choose language and are doing so, backend, that checks for a cookie. Without this cookie they will be redirected to example.com/choosecountry. This, of course, is not good for SEO for the English version of the page. To Google - all pages will look like the language chooser.



I know it would be best to have example.com/en or so, but it's not possible at the moment. So I'm thinking about a JavaScript redirect instead. Read the cookie with JS cookie, and if it's not there, do a window.locaton.href. But nowadays it seems as the Google bots actually is reading JavaScript files, and their latest Ajax recommendations (http://googlewebmastercentral.blogspot.se/2015/10/deprecating-our-ajax-crawling-scheme.html) says it will follow links as a normal browser does.



So my question is - would the bots ignore the pages because it redirects, or would they still be included in the index? At this moment it would not be possible to index the site at all, because the server does not give any HTML data other than the language chooser. To check the user agent and not redirect Google bots is not an option - We would probably get punished for that?


Solution :

Google recommends using <link rel="alternate" hreflang="x-default" href="example.com/choosecountry"> for country-chooser/redirector pages.



So your markup will be:



<link rel="alternate" hreflang="en" href="http://example.com">
<link rel="alternate" hreflang="fr" href="http://example.com/fr">
<link rel="alternate" hreflang="sv" href="http://example.com/se">
<link rel="alternate" hreflang="x-default" href="http://example.com/country-chooser">


When you are redirecting cookie-less users to the country chooser, you are doing that even if they visit the FR or SE version, and not just from the English version. Is that correct?



If that is correct, Googlebot will not be able to read any of those versions. Because Googlebot will never have a cookie set; it will always get redirected. This is not ideal.



Can you have a country-chooser widget on the top navigation? See Asos.com for an example.



Instead of forcing your users to choose a market and language, you should detect cases when the user is likely in the wrong place and put a prominent notice near the top of the page:




Your IP address appears to come from Germany.



[Visit our German site]




or




You have set the language preference (Accept-Language header) in your browser to German.



[Visit our German site]




(It would be best for those messages to be in German, even on the English site.)



This has many advantages:




  • It's easier for users. They don't have to choose anything. This increases engagement.

  • Your pages are crawlable and indexable by search engines. No cloaking worries either.

  • Users that visit the wrong site can make their way to the correct site easily.

  • Users aren't forced to the wrong site by automatic redirects (eg. a British tourist visiting an internet cafe in Germany.)


We hope that this article has helped you resolve the seo, redirects, javascript error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

How to redirect to any domain [duplicate]

"302 found" for index page bad for SEO?

Create redirect from url like www.example.us/?p=100&option=