Last active
May 8, 2018 21:40
-
-
Save thegrid22593/a8a5c1870bf81d500e0f1609e7b9bab1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Forward entire domain | |
``` | |
RedirectMatch 301 ^(.*)$ http://www.valenciamorganhill.com/ | |
``` | |
#### Forward entire domain alt. | |
``` | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} ^lyonautumnchase.com$ [OR] | |
RewriteCond %{HTTP_HOST} ^www.lyonautumnchase.com$ | |
RewriteRule ^(.*)$ http://www.lyoncommunities.com/communities/welcome/autumn-chase [R=301,L] | |
``` | |
#### Add SVG Support | |
``` | |
AddType image/svg+xml svg svgz | |
AddEncoding gzip svgz | |
``` | |
#### Redirect non-www urls to www | |
``` | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} !^www\.yoursite\.com | |
RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L] | |
``` | |
#### Redirect non-www urls to www | |
``` | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^example\.com [NC] | |
RewriteRule (.*) http://www.example.com/$1 [R=301,L] | |
``` | |
#### Force https:// | |
``` | |
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] | |
``` | |
#### Force https & www at the same time | |
``` | |
RewriteEngine On | |
RewriteCond %{HTTPS} off [OR] | |
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] | |
RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301] | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment