g1smd - 9:51 pm on Oct 15, 2012 (gmt 0) [edited by: g1smd at 9:59 pm (utc) on Oct 15, 2012]
\.html? pattern matches both
.htm requests. Redirect both. I actually use
? after hostname paired with
$ stops an infinite redirect loop for pure
HTTP/1.0 requests. Pure
HTTP/1.0 requests do not include a host header.
^example\.com$ pattern doesn't allow a redirect for requests for
www.example.com:80 nor many other non-canonical hostnames.
The code above redirects all requests when the requested hostname is not "exactly" www.example.com all in lower case.
(.*) is greedy and captures "everything" so you don't need to tell it start at the beginning and continue to the end. It does that on its own.
[edited by: g1smd at 9:59 pm (utc) on Oct 15, 2012]