10

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.

1 Answer 1

15

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!

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.