- Category: Linux and Apache
- Last edited: July 24, 2013
Recently I needed to redirect traffic when the domain was NOT www.website.co.nz. This is often handy if you have several domains hinged off one virtual host.
RewriteCond %{HTTP_HOST} !^www\.website\.co\.nz$ [NC]
RewriteRule .* http://%{HTTP_HOST} [R=301,L]