Created
February 19, 2018 23:42
-
-
Save djom202/5241bac341ddc41b43fb23066a9f3530 to your computer and use it in GitHub Desktop.
force ssl and redirect to index.php
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
RewriteEngine On | |
RewriteBase / | |
#if the request is not secure | |
RewriteCond %{HTTPS} off | |
#redirect to the secure version | |
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L] | |
#These are your existing rules | |
RewriteCond %{REQUEST_FILENAME} !.(jpg|jpeg|gif|png|css|js|pl|txt)$ [NC] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.*) index.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment