Created
June 13, 2018 13:34
-
-
Save joshuaadrian/de88d43e693ec8e73b178974151d5d46 to your computer and use it in GitHub Desktop.
htaccess https redirect
This file contains hidden or 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
#Redirect Non-WWW to WWW with SSL | |
RewriteCond %{ENV:HTTPS} !on [NC] | |
RewriteRule ^(.*)$ https://www.domain.com/$1 [NC,R=301,L] | |
#Redirect Non-WWW to WWW | |
RewriteCond %{HTTP_HOST} ^domain.com [NC] | |
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L] | |
#Redirect alternative domains | |
RewriteCond %{HTTP_HOST} ^domain.com.php53-13.dfw1-1.websitetestlink.com$ [NC,OR] | |
RewriteCond %{HTTP_HOST} ^www.domain.com.php53-13.dfw1-1.websitetestlink.com$ [NC] | |
RewriteRule (.*) https://www.domain.com/$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment