Chinese traffic redirection

Chinese traffic redirection - 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 Chinese traffic redirection error on your web browser. Problem :


Our company website currently has 13 languages, of which Chinese is one. We have seen significant bounce rates from visitors in China (largely due to site speed there) and so we will be launching a standalone Chinese website that is hosted in mainland China in the coming days.



The new Chinese site features less functionality than our main site and highlights fewer products than our company offers - this is to aid our SEM/Weibo/Wechat campaigns in that market which only target specific products.



I don't want to redirect the Chinese language version of our website to the new Chinese site as 1) A Chinese speaking visitor is not necessarily currently within China 2) Our CDN doesn't include China meaning the new site will be a lot slower than our global site if you are outside of China 3) Our global site has seen years of MVT / AB testing.



Is it possible to redirect visitors from the Chinese language version of our site (this is in a subdirectory of our main site) to the new Chinese site ONLY if the visitor is located within China?



If possible, does this go against best practice?



To recap:



The Chinese website needs to be for visitors INSIDE China.
The Chinese version of our global site is for Chinese speaking visitors OUTSIDE China.


Solution :

Assuming you're running Apache, this can be achieved with the mod_geoip and mod_rewrite modules.



Once you have those installed properly and your URL structures will be the same on the Chinese and non-Chinese sites, you can achieve your desired result with code that will look something like



RewriteEngine on
RewriteCond %ENV:GEOIP_COUNTRY_CODE ^(CN|HK)$
RewriteRule ^(.*)$ http://www.mydomain.cn/$1 [L]


This will basically look at the visitors country code returned by the geo_ip module. In this case, if it's CN or HK (Hong Kong) it will redirect the user to the same path their requesting on the "main" server, only at the domain www.mydomain.cn the $1 at the end of that rule appends the current request to the new request.


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