Created
November 7, 2019 10:02
-
-
Save w-jerome/558223b0fc739839a205eb44d58ccd4d to your computer and use it in GitHub Desktop.
Htaccess - Basic config
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
# Pass the default character set | |
AddDefaultCharset utf-8 | |
# BEGIN Rewrite rules | |
RewriteEngine On | |
RewriteBase / | |
# Redirection www | |
RewriteCond %{HTTP_HOST} ^site\.com$ [NC] | |
RewriteRule ^(.*)$ https://www.site.com/$1 [R=301,L] | |
# Redirect https | |
RewriteCond %{HTTPS} !=on | |
RewriteCond %{HTTP_HOST} ^www\.site\.com | |
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L] | |
# Rewrite URL | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment