#
# Configuracoes principais
#
Options -ExecCGI -MultiViews -Indexes
DirectoryIndex index.php index.html index.htm
DefaultLanguage pt-BR
AddDefaultCharset ISO-8859-1
ServerSignature Off
#
# Configuracoes de "headers", cache e outras otimizacoes
#
# Disable caches and browsers from being able to validate files,
# so they are forced to rely on your Cache-Control and Expires header.
Header unset ETag
FileETag None
#-> http://www.htaccesselite.com/htaccess/cache-control-http-headers-vt65.html
# 300 5 M
# 2700 45 M
# 3600 1 H
# 54000 15 H
# 86400 1 D
# 518400 6 D
# 604800 1 W
# 1814400 3 W
# 2419200 1 M
# 26611200 11 M
# 29030400 1 Y (never expire)
## HEADER CACHING ##
#-> http://www.htaccesselite.com/htaccess/caching-using-header-vt2.html
#
# Header set Cache-Control "max-age=2592000"
#
#
# Header set Cache-Control "max-age=604800"
#
#
# Header set Cache-Control "max-age=600"
#
#
# Header unset Cache-Control
#
## ALTERNATE EXPIRES CACHING ##
#-> htaccesselite.com/d/use-htaccess-to-speed-up-your-site-discussion-vt67.html
#
# ExpiresActive On
# ExpiresDefault "access plus 1 day"
# Permite que os arquivos sejam "cacheados" tanto para http quanto para https
# Header set Cache-Control "public"
# ExpiresByType text/html "access plus 1 hour"
# ExpiresByType text/plain "access plus 1 hour"
# ExpiresByType text/css "access plus 1 hour"
# ExpiresByType text/javascript "access plus 1 hour"
# ExpiresByType application/x-javascript "access plus 1 hour"
# ExpiresByType image/gif "access plus 1 week"
# ExpiresByType image/jpg "access plus 1 week"
# ExpiresByType image/png "access plus 1 week"
#
#ExpiresActive Off
#
#
#
# Compactacao
#
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/atom_xml
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE image/svg+xml
# Use low settings for compression to make sure impact on server is low
#DeflateMemLevel 2
#Highest 9 - Lowest 1
#DeflateCompressionLevel 9
#Skip browsers with known problems
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# properly handle requests coming from behind proxies
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:avi|mov|mp3|ogg|wmv|wma)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
# Log file compression
# DeflateFilterNote Input instream
# DeflateFilterNote Output outstream
# DeflateFilterNote Ratio ratio
# LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
# CustomLog /var/log/apache2/deflate.log deflate
#
# Reescritas e redirecionamentos
#
RewriteEngine On
## DENY REQUEST BASED ON REQUEST METHOD ##
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|HEAD)$ [NC]
RewriteRule ^.*$ - [F]
RewriteRule ^rest(.*)$ prototype/rest/$1 [QSA,L]
#
# Seguranca e restricoes de acesso
#
# Ao próprio htaccess e outros arquivos sensiveis (como senhas)
Order Allow,Deny
Deny from all
Satisfy any
#
# Options None
# Order deny,allow
# # Sua rede local
# allow from 192.168.0.0/24
#
#
# Configuracoes do PHP para o Expresso
# IMPORTANTE: estas configurações não serão carregadas
# em ambientes que executam o PHP via FastCGI, FPM,
# ou similares. Nestes casos, estas configurações
# devem ser adicionadas diretamente ao php.ini.
#
# Configuracoes de sessao
php_flag session.auto_start Off
php_flag session.use_cookies Off
# Uses dir as a session handler
php_value session.save_handler "files"
php_value session.save_path "/dev/shm"
# Use memcache as a session handler
#php_value session.save_handler "memcache"
#php_value session.save_path "tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
php_value session.serialize_handler "php"
php_value session.gc_probability 1
php_value session.gc_divisor 100
php_value session.gc_maxlifetime 14400
php_value session.cache_limiter nocache
php_value session.cache_expire 180
php_flag session.use_trans_sid Off
php_flag short_open_tag On
php_flag zlib.output_compression Off
php_flag output_buffering Off
php_flag register_argc_argv On
php_flag allow_url_include Off
php_value variables_order "EGPCS"
php_value default_charset "iso-8859-1"
php_value default_mimetype "text/html"
php_value date.timezone "America/Sao_Paulo"
php_value url_rewriter.tags "a=href,area=href,frame=src,form=,fieldset="
#php_value url_rewriter.tags "a=href,area=href,frame=src,input=src,form=,fieldset="
php_value mbstring.func_overload "0"
#php_value mbstring.func_overload "7"
#php_flag mbstring.strict_detection On
php_value max_execution_time 90
php_value max_input_time 120
php_value memory_limit 196M
php_value post_max_size 50M
php_value upload_max_filesize 40M
# Para ambiente de desenvolvimento
#php_flag log_errors On
#php_value error_reporting "E_ALL & ~E_NOTICE"
#php_flag ignore_repeated_errors On
#php_flag report_memleaks On
#php_flag html_errors On
#php_value error_log /tmp/php.log
# deprecate 5.3.0, removed 5.4.0
php_flag magic_quotes_gpc Off
php_flag magic_quotes_runtime Off
php_flag register_globals Off
php_flag register_long_arrays Off
php_flag allow_call_time_pass_reference On
php_flag session.bug_compat_42 0
php_flag session.bug_compat_warn 0