Top Nav

Canonical Rewrite Rules

Here’s a good rule set for forcing use of a preferred url:

This version of the canonical rewrite expands on the original found here:

by adding:

  1. redirects domains with suffixes (not just prefixes) back to the canonical host; and
  2. allows Host request headers to contain port specifiers (which is allowed by RFC2616 section 14.24)

as suggested here:

and by using a 301 redirect as recommended by Google here: