Last active
September 29, 2017 14:10
-
-
Save kovtunos/60c41b2f36b91c9b637535fff2a0d1c6 to your computer and use it in GitHub Desktop.
Redirect to HTTPS #drupal #htaccess
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 to HTTPS | |
| RewriteCond %{HTTPS} off | |
| RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
| RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
| # Redirect to HTTPS | |
| RewriteCond %{HTTPS} off [OR] | |
| RewriteCond %{HTTP_HOST} ^www.example\.com* | |
| RewriteRule ^(.*)$ https://example.com/$1 [L,R=301] | |
| # Redirect to HTTPS | |
| RewriteCond %{SERVER_PORT} !^443$ | |
| RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] | |
| # Redirect to HTTPS | |
| RewriteCond %{HTTPS} =on | |
| RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L] |
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
| // Drupal settings.php | |
| $base_url = 'https://my.domain.name'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment