0

Is it better to use 301 redirects to URLs with a trailing / to a URL without a trailing / or is it better to canonicalise one version?

4
  • Better in what sense?
    – Steve
    Commented Jul 30, 2015 at 10:59
  • Was referring to which should be used primarily but may as well use both!
    – Tom
    Commented Jul 30, 2015 at 11:04
  • Unless you are overriding the server's behaviour then a URL with or without a trailing slash refers to a different resource. So, it's not just a personal preference, it might be a technical requirement to use one of the other.
    – MrWhite
    Commented Jul 30, 2015 at 19:53
  • There's an answer to another question here that I think will add clarification to some of the answers here. webmasters.stackexchange.com/questions/31796/… Commented May 9, 2016 at 22:47

2 Answers 2

1

The canonical link type is not supported by all user agents, and even if a user agent supports the canonical link type, it may decide to ignore it, so users would end up on the "wrong" URL.

So a 301 redirect is preferable.

This is also the recommendation of the canonical RFC:

Before adding the canonical link relation, verification of the following is RECOMMENDED:

  1. […]

  2. For HTTP, permanent HTTP redirects (Section 10.3.2 of [RFC2616]), the traditional strong indicator that a IRI's content has been permanently moved, could not be implemented in place of the canonical link relation.

  3. […]

0

"Why not both?"

But more serious, you want them both. Use 301 to correct searchengines, and use canonical to indicate preference.

The 301 is the most important one, since that also tell SE's that you dont use the trailing slash url, but the one without.

0

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.