Automatic language redirects seem helpful. In practice they cause some of the worst multilingual bugs: users stuck in the wrong language, search engines unable to crawl alternate versions, and shared links that open differently for each person. Here is a set of rules we apply on multilingual sites for overseas clients.
Rule 1: Never redirect search engine crawlers by IP or Accept-Language
Crawlers usually come from a small set of locations and often send no language preference. If you redirect them, they may never see your other language versions. Every language URL must be reachable directly with a plain request.
Rule 2: Prefer a suggestion banner over a forced redirect
When a visitor's browser language differs from the page language, show a small banner: "This page is also available in Japanese." Let the user choose. Remember the choice in a cookie.
const pageLang = document.documentElement.lang;
const pref = localStorage.getItem('langChoice');
const browser = (navigator.language || '').slice(0, 2);
if (!pref && browser !== pageLang && available.includes(browser)) {
showBanner(browser);
}
Rule 3: If you must redirect, only do it on the root
Redirecting / to /ja/ for Japanese browsers is acceptable when combined with an x-default hreflang for the root. Do not redirect deep links; a shared product URL should open the product, in the language of the link.
Rule 4: Use 302, not 301, for preference-based redirects
A preference-based redirect is not permanent. A 301 can be cached by browsers and confuse users who later switch languages.
Rule 5: Keep hreflang reciprocal and self-referencing
Each version lists all versions, including itself, and every target returns 200. Mismatched hreflang is the most common technical error we find in audits.
Rule 6: Separate language from country unless you truly localize
/de/ is fine for German. /de-at/ only makes sense if prices, shipping or legal content differ for Austria. Over-splitting creates thin duplicates.
Rule 7: Test with real conditions
Use a VPN and different browser languages, and test with JavaScript disabled. Then fetch each language URL with curl and confirm content and hreflang tags.
for l in en ja ko de; do curl -s https://example.com/$l/ | grep -o 'hreflang="[^"]*"' | sort | uniq | tr '\n' ' '; echo; done
If you run WordPress, plugin choice affects how these rules are implemented. We compare the common approaches in our WordPress multilingual website guide.
Published by PandaWM, an overseas marketing team based in Hong Kong.
Top comments (0)