Skip to content

Instantly share code, notes, and snippets.

@sean-kang
Created April 13, 2015 04:24
Show Gist options
  • Save sean-kang/9edf74dc5ec27508e435 to your computer and use it in GitHub Desktop.
Save sean-kang/9edf74dc5ec27508e435 to your computer and use it in GitHub Desktop.
Domain redirection example
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.hello.nz$ [NC]
RewriteRule ^(.*)$ http://hello.nz$1 [L,R=301]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^hello.co.nz$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.hello.co.nz$ [NC]
RewriteRule ^(.*)$ http://hello.nz$1 [L,R=301]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment