public
Last active

ExpressionEngine Rewrite Rules

  • Download Gist
.htaccess
ApacheConf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<IfModule mod_rewrite.c>
 
# Enable Rewrite Engine
# ------------------------------
RewriteEngine On
RewriteBase /
 
# Redirect index.php Requests
# ------------------------------
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{THE_REQUEST} !/system/.*
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L]
 
# Standard ExpressionEngine Rewrite
# ------------------------------
RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
 
</IfModule>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.