Index: /trunk/.htaccess
===================================================================
--- /trunk/.htaccess	(revision 5316)
+++ /trunk/.htaccess	(revision 5419)
@@ -1,3 +1,151 @@
+#
+# 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.
+<ifModule mod_headers.c>
+	Header unset ETag
+</ifModule>
+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
+#<FilesMatch "\.(flv|gif|jpg|jpeg|png|ico)$">
+#	Header set Cache-Control "max-age=2592000"
+#</FilesMatch>
+#<FilesMatch "\.(js|css|pdf|swf)$">
+#   Header set Cache-Control "max-age=604800"
+#</FilesMatch>
+#<FilesMatch "\.(html|htm|txt)$">
+#   Header set Cache-Control "max-age=600"
+#</FilesMatch>
+#<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
+#   Header unset Cache-Control
+#</FilesMatch>
+
+## ALTERNATE EXPIRES CACHING ##
+#-> htaccesselite.com/d/use-htaccess-to-speed-up-your-site-discussion-vt67.html
+#<ifModule mod_expires.c>
+#	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"
+
+	#<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
+		#ExpiresActive Off
+	#</FilesMatch>
+#</ifModule>
+
+#
+# Compactacao
+#
+<IfModule mod_deflate.c>
+	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
+	<IfModule mod_headers.c>
+		# Make sure proxies don't deliver the wrong content
+		Header append Vary User-Agent env=!dont-vary
+	</IfModule>
+
+	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
+
+</ifModule>
+
+
+#
+# Reescritas e redirecionamentos
+#
+RewriteEngine On
+## DENY REQUEST BASED ON REQUEST METHOD ##
+RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|HEAD)$ [NC]
+RewriteRule ^.*$ - [F] 
+
+#
+# Seguranca e restricoes de acesso
+#
+# Ao prÃ³prio htaccess e outros arquivos sensiveis (como senhas)
+<Files ~ "\.(htaccess|htpasswd|ini|srv|log|sh|svn)$">
+	Order Allow,Deny
+	Deny from all
+	Satisfy any
+</Files>
+
+#<Location /setup>
+#	Options None
+#        Order deny,allow
+#	# Sua rede local
+#        allow from 192.168.0.0/24
+#</Location>
+
+#
 # Configuracoes do PHP para o Expresso
+#
+php_value expose_php Off
 php_value short_open_tag On
 php_value zlib.output_compression Off
@@ -16,14 +164,13 @@
 php_value url_rewriter.tags "a=href,area=href,frame=src,input=src,form=,fieldset="
 
-#php_value session.auto_start 1
-php_value session.use_cookies 1
+php_value session.auto_start 0
+php_value session.use_cookies 0
 # Uses dir as a session handler
-#php_value session.save_handler "files"
-#php_value session.save_path "/var/lib/php/session"
+php_value session.save_handler "files"
+php_value session.save_path "/var/lib/php/session"
 #php_value session.save_path "/dev/shm"
 # Use memcache as a session handler
-##php_value session.save_handler "memcache"
-# Defines a comma separated of server urls to use for session storage
-##php_value session.save_path "tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
+#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
@@ -54,6 +201,2 @@
 #php_value html_errors On
 #php_value error_log /dev/shm/php.log
-
-#RewriteEngine On
-#RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
-#RewriteRule .* - [F]
