简体   繁体   English

已在搜索引擎上建立索引的网站本地化

[英]Website localization when already indexed on search engines

I found lots of topics on how to localize a website and most common solutions have been adding subdomains or creating different subdirectories(eg. "/en/"). 我发现了许多有关如何本地化网站的主题,最常见的解决方案是添加子域或创建不同的子目录(例如“ / en /”)。 However I could not find anything that worried about loosing Google indexing for sites that originally were localized for only one language. 但是,我找不到担心为最初只针对一种语言进行本地化的网站失去Google索引的担心。

Since now, Google managed to index pages like this: 从现在开始,Google设法将页面编入索引,如下所示:

http://website.com/threads/this-is-the-title/11111

Whenever I decide to opt for localizations in different sub-directories, it would be: 每当我决定选择不同子目录中的本地化时,它将是:

http://website.com/en/threads/this-is-the-title/11111

What will happen to the hundreads of pages index by Google? Google对页面索引的乱码会发生什么? Can you help me figuring out a solution to localize a website without having trouble with Google? 您能帮我找出解决方案来对网站进行本地化而又不会遇到Google问题吗?

What I found that partially solves the problem 我发现部分解决了问题

Hreflang: https://support.google.com/webmasters/answer/189077?hl=en Hreflang: https//support.google.com/webmasters/answer/189077?hl = zh_CN

This would work except for the fact that I'll find myself with localization on two different folder levels: 除了我将在两个不同文件夹级别上进行本地化之外,这将起作用:

/
    ...files of already index content

    /en
           ...files of the second language

Update: 更新:

Current htaccess file: 当前的htaccess文件:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^threads/(?:([a-zA-Z0-9-_]+\/)?)([0-9]+)$ thread.php?qid=$2 [QSA,L]
...other

I turned that line into: 我把那条线变成:

RewriteRule ^(?:([a-zA-Z]+\/)?)threads/(?:([a-zA-Z0-9-_]+\/)?)([0-9]+)$ $1/thread.php?qid=$3 [QSA,L]

This is not enough, since it does not redirect to a localized sub-directory. 这还不够,因为它不会重定向到本地化的子目录。

Use .htaccess and mod-rewirte to tell google that the url has moved to another uri 使用.htaccess和mod-rewirte 告诉 Google该网址已移至另一个uri

for example 例如

RewriteEngine On
RewriteRule ^oldsite\.html$ /newsite.html [R=301,L]

And google is fine with you 谷歌适合你

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM