On 2014/12/24 06:44, Carlin Bingham wrote:
> ngninx and apache support url rewriting, letting you redirect from
> arbitrary urls with pattern matching. In my experience the primary
> uses for this are to redirect from http to https or to remove/add www
> in the hostname, so I thought it might be useful to have options making
> these specific uses possible and simple to do.

In my experience the primary use is for "clean urls" for various web
applications, which needs a lot more flexibility. Any documentation
relating to setting these up will be using PCRE because that's what the
most common webservers (e.g. Apache, nginx, lighttpd) use, anything
else sets you up for pain when using standard webapps. (OK...they're
mostly PHP....*even more pain* :-)

Perhaps the best approach if this isn't wanted in the main httpd process
would be to do this as a separate fastcgi process..

> This adds an "enforce" option, where "enforce https" redirects non-http
> to https, "enforce www" redirects from example.org to www.example.org 
> <http://www.example.org>,
> and "enforce no www" redirects from www.example.org <http://www.example.org> 
> to example.org.

For https redirects, a better option would be to add support for
adding the Strict-Transport-Security header to responses (HSTS,
RFC 6797), it's safer than issuing a redirect.

Reply via email to