Geolocalization of my website

Geolocalization of my website - 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 Geolocalization of my website error on your web browser. Problem :


I have a big problem with GeoIP. My website has the following structure




  • www.domain.com

  • it.domain.com

  • de.domain.com



I use the MaxMind GeoIP module in Apache to redirect users to the appropriate site base on their country.



My problem is when a user from Italy visits it.domain.com: if ge wants to change language and try to open www.domain.com, he is redirected back to it.domain.com. How can I prevent redirection when a user selects a language.


Solution :

Forget geolocation - it's fundamentally flawed as you have noted. Browsers send an Accept-Language header, check that on your www. site and flip the user, once, to the language they say they prefer. On the subdomains, provide change-language links but do not do any checks.



I develop multi-lingual sites from Japan (read: do this a lot), my standard .htaccess rule for Japanese speakers looks like this:



RewriteCond %HTTP:Accept-Language ^ja.*$ [NC]
RewriteCond %REQUEST_URI "^/$"
RewriteRule .* http://ja.example.com/ [L,R=301]
RewriteCond %HTTP:Accept-Language ^ja.*$ [NC]
RewriteRule .* http://ja.example.com%REQUEST_URI [L,R=301]


And of course there's no database to deal with. Japanese speakers on vacation in Brazil will still see the page in Japanese.



I would use cookie for this on *.domain.com. Special cookie value (let's say lang) should only be set if user clicks on any of the flags. Now on www.domain.com when routing users to localized websites you first check if cookie with lang value is set, if so, you redirect to a page with lang specified in the cookie. If, however, such cookie would not exist, then your redirection should work as usual.


We hope that this article has helped you resolve the htaccess, redirects, apache2 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=