gpt4 book ai didi

php - 已在搜索引擎上编入索引的网站本地化

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:44:43 26 4
gpt4 key购买 nike

我发现了很多关于如何本地化网站的主题,最常见的解决方案是添加子域或创建不同的子目录(例如“/en/”)。然而,我找不到任何担心失去谷歌索引的网站,这些网站最初只本地化为一种语言。

从现在开始,Google 设法将这样的页面编入索引:

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

每当我决定在不同的子目录中选择本地化时,它会是:

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

Google 索引的数百页会怎样?你能帮我找到一个解决方案来本地化网站而不用谷歌吗?

我发现部分解决了问题

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

除了我会发现自己在两个不同的文件夹级别进行本地化之外,这会起作用:

/
...files of already index content

/en
...files of the second language

更新:

当前的 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

我把那行变成了:

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

这还不够,因为它不会重定向到本地化的子目录。

最佳答案

使用 .htaccess 和 mod_rewrite 来告诉谷歌该 url 已移动到另一个 uri

例如

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

Google 对你没问题

关于php - 已在搜索引擎上编入索引的网站本地化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27837863/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com