问题描述
SEO和301重定向-它们可以有相对路径还是必须是绝对路径?
SEO and 301 redirects - Can they have relative paths or must they be absolute?
在对页面执行301重定向时,BOT/蜘蛛程序将去往相对路径(redirect ="../")的301与去到绝对路径(redirect = "http://www.somewebsite.com/apage/").
When doing a 301 redirect for a page, are the BOTs/Spiders going to treat a 301 that goes to a relative path (redirect="../") the same as one that goes to an absolute path (redirect="http://www.somewebsite.com/apage/").
例如,我有一个包含内容的父页面( http://www.somewebsite.com/apage/)上...我有一个子页面( http://www.somewebsite.com /apage/more-details ),上面有更多内容.
For example I have a parent page with content (http://www.somewebsite.com/apage/) on it... I have a subpage (http://www.somewebsite.com/apage/more-details) with further content on it.
我计划将更多内容移至主页本身,并摆脱( http: //www.somewebsite.com/apage/more-details ),但是我想使用301将漫游器/浏览器重定向到升级页面( http://www.somewebsite.com/apage/),这样我就不会失去任何页面排名等.
I plan to move the further content into the main page itself and get rid of the (http://www.somewebsite.com/apage/more-details), but I want to use a 301 to redirect bots/browsers to the page on level up (http://www.somewebsite.com/apage/) so I dont lose any page rank etc.
推荐答案
每标准,RFC 2616,"[Location]字段值由单个绝对URI组成."在任何"Location:"标头(301或其他方式)中使用相对URI都违反了标准,使您受陌生人(浏览器,蜘蛛等的创建者)的摆布.对于遵循标准-始终在位置标头中使用绝对URI!
Per The Standard, RFC 2616, "The [Location] field value consists of a single absolute URI." Using a relative URI in any "Location:" header (301 or otherwise) violates the standard and puts you at the mercy of strangers - the authors of browsers, spiders, etc. It's MUCH simpler, safer, and sounder, to follow the standard -- always use absolute URIs in your location headers!
这篇关于SEO和301重定向-它们可以有相对路径还是必须是绝对路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!