被 Google 丑化的美化网址
我有一个小问题,在过去的几个月里一直困扰着我。
首先是好消息:在庞大的 SO 社区的帮助下,我能够将丑陋的 URL 重写为漂亮的 URL,例如将 website.com/page.ast?ln=nl
重写为 website。 com/nl/page
。对于 Apache 的那点 .htaccess
魔力,我永远感谢 SO 社区。
但在愉快的开发过程中,我在 Google 搜索结果中发现了一个令人讨厌的事实...
Google 在其搜索中显示了丑陋的 URL:
website.com/nl/selfdesign.ast?ln=fa
同时:
我的网站在其菜单系统中有很好的超链接:
在页面上时,该网站会加载,并且 Firefox 的 URL 栏会显示漂亮的 URL:
http://website.com/nl/selfdesign
我的网站页面的代码显示了以下规范元:
所以,我认为我的美化网址已经被谷歌丑化了。非常感谢! 在我花了几个月的时间美化我的链接之后,谷歌怎么可能显示丑陋的网址呢?
更新 2
那么如何将像 website.com/nl/webpage.ext?ln=yy
这样的 URL 重定向到 website.com/nl/webpage
,从本质上删除不必要的部分哪个没有任何作用?
.xxx?ln=yy
其中 xxx
是 2 或 3 个字母的字符(扩展名),yy
是一种语言(可以是 >nl
、be
、fr
还有 zh-cn
等)。
同样,过去的任何内容(包括 .extension?ln=whatever
)都可以完全删除并重定向到。
I have a little problem that's been bothering me for the last few months.
First the good news: with the help of the massive SO community I was able to rewrite my ugly URLs into nice ones, e.g. website.com/page.ast?ln=nl
into website.com/nl/page
. For that little .htaccess
Apache magic I'm eternally thankful to the SO community.
But happily developing along, I came across a nasty truth in Google search results...
Google shows the ugly URLs in their search:
website.com/nl/selfdesign.ast?ln=fa
While:
My website has nice hyperlinks in its menu system:
<a href="selfdesign">designing your own website</a>
When on the page, that website loads and Firefox's URL bar shows the nice URL:
http://website.com/nl/selfdesign
My site page's code reveals the canonical following meta:
So, I think my beautified URLs have been uglified by Google. Thanks very much!
How is it possible for Google to show the ugly URLs after all these months I spent beautifying my links?
Update 2
So how can I redirect URLs like website.com/nl/webpage.ext?ln=yy
to website.com/nl/webpage
, essentially removing the unnecessary part which doesn't do anything?
.xxx?ln=yy
where xxx
is is a 2 or 3 letter char (extension) and yy
is a language (can be nl
, be
, fr
but also zh-cn
, etc.) .
Again anything past and including the .extension?ln=whatever
can be completely removed and redirected towards.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您还需要为所有旧 URL 设置 301 重定向到新方案。此 301 重定向将告诉 Google 更新其在搜索引擎中的 URL。
更新 2
以下是反转的方法:
You need to also setup 301 redirects for all your legacy URLs to your new scheme. This 301 redirect will tell Google to update its URLs in the search engine.
Update 2
Here is how you would reverse it: