Return to Snippet

Revision: 23243
at February 1, 2010 22:47 by davidbani


Initial Code
# secure .htaccess file
<Files .htaccess>
 order allow,deny
 deny from all
</Files>

# Dont list files in index pages
IndexIgnore *

# EE 404 page for missing pages
ErrorDocument 404 /index.php?/{ee:404}

# Simple 404 for missing files
<FilesMatch "(\.jpe?g|gif|png|bmp)$">
  ErrorDocument 404 "File Not Found"
</FilesMatch>

RewriteEngine On

RewriteBase /

# remove the www
RewriteCond %{HTTP_HOST} ^(www\.$) [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Add a trailing slash to paths without an extension
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule ^(.*)$ $1/ [L,R=301]

# Remove index.php
# Uses the "include method"
# http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method
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>

php_value memory_limit 16M

Initial URL


Initial Description


Initial Title
.htaccess modified

Initial Tags
htaccess

Initial Language
PHP