href:我可以让Google搜索结果使用/显示最终的重定向网址吗? [英] href: Can I get Google search results to use/display the final redirect url?

查看:115
本文介绍了href:我可以让Google搜索结果使用/显示最终的重定向网址吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站有使用以下格式的网页网址:

  www.mysite.com/id/pretty_title 

首页链接到这些页面,但href实际上包含一些参数:

  www.mysite.com/id/?some_ugly_parameters_to_let_me_know_what_search_it_is_from 

然后重定向至

  www.mysite.com/id/pretty_title 



显示页面。



我的问题是 b>谷歌的搜索结果显示该页面的链接是丑陋的,而不是漂亮的重定向页面。除了看起来很丑陋之外,它可能会导致错误,因为丑陋链接中包含的参数与直接从Google进入页面的用户无关。



我可以通过Google只使用最终的重定向url?或以其他方式避免此问题?我确实需要传递这些参数。在会话中存储信息将不起作用,因为用户可以打开多个标签。

在丑陋的URL页面您将< link rel =canonicalhref =www.mysite.com/id/pretty_title> 这会告诉搜索引擎您的首选内容网址。

也可以设置 www.mysite.com/id/?some_ugly_parameters_to_let_me_know_what_search_it_is_from 以使 301重定向到您漂亮的URL



规范网址: https://support.google.com/webmasters/answer/139066

<301>重定向: https://support.google.com/webmasters/answer/93633?hl=zh_CN


My site has webpage urls that use the following format:

www.mysite.com/id/pretty_title

The front page links to these pages, but the href actually contains some parameters:

 www.mysite.com/id/?some_ugly_parameters_to_let_me_know_what_search_it_is_from

This then redirects to

www.mysite.com/id/pretty_title

which shows the page.

My issue is that Google's search results show the link to the page as the ugly one instead of the pretty redirected one. Besides looking ugly, it can cause errors because the parameters that are included in the ugly link are irrelevant to a user who directly enters a page from Google.

Can I get Google to only use the final redirect url? Or otherwise avoid this issue? I do need to pass these parameters along. Storing info in the session won't work because a user can have several tabs open.

解决方案

On the "ugly URL page" you put <link rel="canonical" href="www.mysite.com/id/pretty_title"> which tells the search engine your preferred URL for that content.

Can also set www.mysite.com/id/?some_ugly_parameters_to_let_me_know_what_search_it_is_from to have a 301 redirect to your pretty URL

Canonical URLs: https://support.google.com/webmasters/answer/139066

301 Redirects: https://support.google.com/webmasters/answer/93633?hl=en

这篇关于href:我可以让Google搜索结果使用/显示最终的重定向网址吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆