# Standard .htaccess file
# Secure .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>
# Don’t show any directory without an index file
Options -Indexes
# Dont list files in index pages
IndexIgnore *
# EE 404 page for missing pages
# May differ depending on where your template is located.
# ErrorDocument 404 /index.php?/site/404
# Enable Rewrite Engine
RewriteEngine On
RewriteBase /
# Remove the www from the URL
# You may be able to do this through your web host or you may not need it at all.
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
# RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# Force the www (not used here but listed for reference)
# RewriteCond %{HTTP_HOST} !^www\.
# RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# Add a trailing slash to paths without an extension
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule ^(.*)$ $1/ [L,R=301]
# Google Analytics
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^(gclid=.*)
RewriteRule ^(.*)$ /index.php?/ [L,PT]
# Remove index.php
# Uses the “exclude method”
# http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Exclude_List_Method
# This method seems to work best for us, you might also use the include method.
# http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method
# Exclude root files
RewriteCond $1 !^(favicon\.ico|index\.php|path\.php|php\.ini) [NC]
# Exclude EE folders
RewriteCond $1 !^(editor|expressionengine_system|images|theme|upload)/ [NC]
# Exclude 3rd party folders
RewriteCond $1 !^(css|js|assets)/ [NC]
# Exclude image files
RewriteCond $1 !^(\.gif|\.jpg|\.png) [NC]
# Remove index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
# Remove IE image toolbar
# <FilesMatch “\.(html|htm|php)$”>
# Header set imagetoolbar “no”
# </FilesMatch>
# RewriteCond %{REQUEST_URI} ^/index.php/member
# RewriteRule ^index.php/(.*)$ /forum/$1 [L,R=Permanent]
RewriteCond %{REQUEST_URI} ^/index.php/forum/member
RewriteRule ^index.php/forum/(.*)$ /$1 [L,R=Permanent]
RewriteCond %{REQUEST_URI} ^/forum/member
RewriteRule ^/forum/(.*)$ /$1 [L,R=Permanent]
# RewriteCond %{REQUEST_URI} ^/index.php/forum/
# RewriteRule ^index.php/(.*)$ /$1 [L,R=Permanent]