Skip to content

Instantly share code, notes, and snippets.

@loughlincodes
Created January 4, 2019 15:03
Show Gist options
  • Save loughlincodes/cc89d2ed617e17c1ae09c87404138752 to your computer and use it in GitHub Desktop.
Save loughlincodes/cc89d2ed617e17c1ae09c87404138752 to your computer and use it in GitHub Desktop.
ExpressionEngine 5.x htaccess
<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