Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
556 views
in Technique[技术] by (71.8m points)

search engine - SEO and 301 redirects - Can they have relative paths or must they be absolute?

SEO and 301 redirects - Can they have relative paths or must they be absolute?

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/").

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.

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...