

ErrorDocument 404 /errors/notfound.php
ErrorDocument 500 /errors/serverr.php

<IfModule mod_rewrite.c>

RewriteEngine on
RewriteBase /

RewriteRule ^noticia/images\/(.*)$ images/$1 [L]
RewriteRule ^noticia/includes\/(.*)$ includes/$1 [L]
RewriteRule ^noticia/js\/(.*)$ js/$1 [L]
RewriteRule ^noticia/(.*)$ noticia_detalhe.php?id=$1 [L]


### Remove Index da URL
	RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^/]+/)*index\.php[?]? [NC]
	RewriteRule ^(([^/]+/)*)index\.php$ http://%{HTTP_HOST}/%1 [NC,R=301,L] 


### Sem extensão
	RewriteCond %{THE_REQUEST} ^GET\ (.*)\.php\ HTTP
	RewriteRule (.*)\.php$ $1 [R=301]
	
	# remove slash if not directory
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteCond %{REQUEST_URI} /$
	RewriteRule (.*)/ $1 [R=301]
	
	# add .php to access file, but don't redirect
	RewriteCond %{REQUEST_FILENAME}.php -f
	RewriteCond %{REQUEST_URI} !/$
	RewriteRule (.*) $1\.php [L]

   RewriteCond %{HTTP_HOST} !^www\.normatoc\.pt$ [NC]  
   RewriteRule .? http://www.normatoc.pt%{REQUEST_URI} [R=301,L]  


</IfModule>

######################## Cache de Conteudos #####################################################
Header unset ETag
FileETag None

<IfModule mod_expires.c>
ExpiresActive On
<FilesMatch "\.(xml|txt|html|js|css|gif|jpg|jpeg|png|woff|flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|swf)$">
	ExpiresDefault "access plus 1 month"
	Header set last-modified  "Sun Jul 18 00:32:50 EDT 2004" 
	Header append Vary Accept-Encoding
</FilesMatch>

<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
	ExpiresActive Off
	Header set Cache-Control "no-cache, proxy-revalidate, must-revalidate"
	Header set Pragma "no-cache"
</FilesMatch>
</IfModule>
########################################################################################################
###################### Compressão ######################################################################
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript
</IfModule>
########################################################################################################