On our site, locale specific URLs are accessible across domains.
Say we have two URLs: dog.aspx
(English) and hund.aspx
(German).
The following URLs work:
www.example.com/hund.aspx
(displays English content, not German,but URL is German)www.example.de/hund.aspx
(correct URL)To solve this, we have two options:
www.example.com/hund.aspx
redirect to www.example.com/dog.aspx
Have canonical
URL in www.example.com/hund.aspx
to www.example.com/dog.aspx
What is more preferable? 301 redirect or canonical
URL?
A 301 redirect is preferable to a canonical
declaration.
User agents can’t bypass redirects, while canonical
is only an advice which a) not all user agents support, and b) even user agents that support it don’t have to follow it.
RFC 6596 recommends this, too:
Before adding the canonical link relation, verification of the following is RECOMMENDED:
[…]
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.
[…]