Make Nginx server support Chinese URL configuration details

  • 2020-05-10 23:26:19
  • OfStack

Chinese URL has been an old topic, up to now there are still a large part of SEOer will say don't use Chinese URL, is not friendly to search engines.

However, that has been the past, Google very early support of Chinese URL, when baidu technology did not keep up with, URL will appear messy code.

In the algorithm of Google, URL contains keywords and will assign 1 fixed weight to the page. English is, and so is Chinese. Deadwood guess that baidu did not give Chinese URL weight before, probably because of recognition problems.

After some simple tests, deadwood found that Chinese URL contained keywords, which had a very positive impact on baidu SEO.

However, the need to pay attention to is the best use of UTF8 code, although baidu has a "definite ability to identify", but do not guarantee 5 flower 8 door code will not be a problem.

The Chinese version of URL was displayed in the search results of baidu. However, the address bar was still unappealing after I clicked on it. In addition to doing a long tail, I tried to avoid using Chinese version of URL. Of course, if you don't care about this, why not switch to Chinese URL for the whole station? You will have an unexpected gain.

Let's take a look at the configuration of Nginx to support Chinese url:

NGINX does not need to load the supporting Chinese module separately as apache does.


# cat /etc/sysconfig/i18n 
LANG="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16"

If no i18n is created, restart the system.

The server-side character set is as follows


# locale
LANG=en_US.UTF-8
LC_CTYPE= " en_US.UTF-8 " 
LC_NUMERIC= " en_US.UTF-8 " 
LC_TIME= " en_US.UTF-8 " 
LC_COLLATE= " en_US.UTF-8 " 
LC_MONETARY= " en_US.UTF-8 " 
LC_MESSAGES= " en_US.UTF-8 " 
LC_PAPER= " en_US.UTF-8 " 
LC_NAME= " en_US.UTF-8 " 
LC_ADDRESS= " en_US.UTF-8 " 
LC_TELEPHONE= " en_US.UTF-8 " 
LC_MEASUREMENT= " en_US.UTF-8 " 
LC_IDENTIFICATION= " en_US.UTF-8 " 
LC_ALL=

The character set configured in the nginx.conf file is also utf-8


server {
listen 80;
server_name test.cn;
root /data;
index index.html index.jsp;
charset utf-8;
 ... 

The client USES secureCRT, and the character set is changed to utf-8. After using uft-8, the file can be uploaded by rz. Under ie, Chinese can be displayed normally.


Related articles: