Created
April 10, 2020 03:19
-
-
Save lshaf/478435e6abc60e9ac79e1601ae90c1cd 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
RewriteEngine on | |
# Option 1: To rewrite "www.domain.com -> domain.com" uncomment the following lines. | |
RewriteCond %{HTTPS} !=on | |
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] | |
RewriteRule ^(.*)$ https://%1/$1 [R=301,L] | |
# If a directory or a file exists, use the request directly | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
# Otherwise forward the request to index.php | |
RewriteRule . index.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment