Created
January 4, 2019 15:03
-
-
Save loughlincodes/cc89d2ed617e17c1ae09c87404138752 to your computer and use it in GitHub Desktop.
ExpressionEngine 5.x htaccess
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# RewriteBase / | |
# Force HTTPS | |
RewriteCond %{HTTPS} off | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
# Removes index.php from ExpressionEngine URLs | |
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC] | |
RewriteCond %{REQUEST_URI} !/system/.* [NC] | |
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L] | |
# Directs all EE web requests through the site index file | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ /index.php?/$1 [L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment