# Necessary to prevent problems when using a controller named "index" and having a root index.php
# more here: http://httpd.apache.org/docs/2.2/content-negotiation.html
Options -MultiViews
# Activates URL rewriting (like myproject.com/controller/action/1/2/3)
RewriteEngine On
# Disallows others to look directly into /public/ folder
Options -Indexes
# When using the script within a sub-folder, put this path here, like /mysubfolder/
# If your app is in the root of your web folder, then leave it commented out
# RewriteBase /php-mvc/
# General rewrite rules
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !.(js|ico|gif|jpg|png|css|swf|mp3|wav|txt|xml)$
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
IndexIgnore *
ErrorDocument 404 /home
SetEnv PHP_VER 5
Header unset ETag
FileETag None
<FilesMatch ".(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
# Cache anual
<FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|js|css)$">
Header set Cache-Control "max-age=31536000, public"
</FilesMatch>
# Cache 3 dias
<FilesMatch ".(html|htm)$">
Header set Cache-Control "max-age=259200, public"
</FilesMatch>
# Cache 1 hora
<FilesMatch ".(php|php5)$">
Header set Cache-Control "max-age=36000, public"
</FilesMatch>