#php_value include_path ".;D:\Ampps\www\pribuildTest\"
#suPHP_ConfigPath /home/primari/public_html/pribuild2/

#AddHandler application/x-httpd-php53 .css

# Or, compress certain file types by extension:


### Error Pages
ErrorDocument 400 /error-code.php
ErrorDocument 401 /error-code.php
ErrorDocument 403 /error-code.php
ErrorDocument 404 /error-code.php
ErrorDocument 500 /error-code.php
ErrorDocument 502 /error-code.php
ErrorDocument 504 /error-code.php

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
RewriteBase /

### Prevent Showing Tree Folder
	Options -Indexes

### 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]


	#RewriteRule ^analytics/$ includes/analytics.php
	#RewriteRule ^mailchimp/$ includes/mailchimps.php
	
### URL Rewrite
#### FORMATO URL - http://domain.tdl/pagina/lingua/parametro1/parametro2/parametro3
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteCond %{REQUEST_FILENAME} !-f
	#RewriteCond %{REQUEST_URI} !^.*\.(css|jpeg|gif|png|js|ico)$ [NC]
	RewriteCond %{REQUEST_URI}  !\.(php|html?|jpg|gif|png|ico|jpeg|css)$
	RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301]
	RewriteRule ^admin/$ admin.php

	RewriteRule ^([a-zA-Z0-9_-]+)/atestado-de-idoneidade/$ servicos-online.php?id=1&lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/insuficiencia-economica/$ servicos-online.php?id=2&lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/declaracao-de-residencia/$ servicos-online.php?id=3&lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/prova-de-vida/$ servicos-online.php?id=4&lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/o-cidadao/$ content_page.php?id=99&lingua=$1

	RewriteRule ^([a-zA-Z0-9_-]+)/historia/$ content_page.php?id=1&lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/heraldica/$ content_page.php?id=2&lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/patrimonio-arquitectonico/$ content_page.php?id=3&lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/patrimonio-natural/$ content_page.php?id=4&lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/ruas-codigos-postais/$ content_page.php?id=5&lingua=$1

	RewriteRule ^([a-zA-Z0-9_-]+)/junta-de-freguesia/$ content_page_menu.php?lingua=$1

	RewriteRule ^([a-zA-Z0-9_-]+)/freguesia/$ content_page.php?id=6&lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/mensagem-do-presidente/$ content_page.php?id=7&lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/assembleia-de-freguesia/$ content_page.php?id=8&lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/executivo/$ content_page.php?id=9&lingua=$1

	RewriteRule ^([a-zA-Z0-9_-]+)/destaques/1/$ content_page.php?id=10&lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/destaques/2/$ content_page.php?id=11&lingua=$1


	RewriteRule ^([a-zA-Z0-9_-]+)/editais/$ content_page.php?id=50&lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/recenseamento-militar/$ content_page.php?id=51&lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/recolha-de-lixo/$ content_page.php?id=52&lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/necrologia/$ content_page.php?id=53&lingua=$1


	RewriteRule ^([a-zA-Z0-9_-]+)/galeria/([a-zA-Z0-9_-]+)\.html$ galerias_detalhe.php?id=$2&lingua=$1

	RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/$ $2.php?lingua=$1
	RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/page/([0-9]+)/$ $2.php?lingua=$1&page=$3
	RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/$ $2.php?lingua=$1&category=$3
	RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/page/([0-9]+)/$ $2.php?lingua=$1&category=$3&page=$4
	RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)\.html$ $2.php?lingua=$1&url=$3
	#RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ $2.php?lingua=$1&parametro1=$3
	#RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ $1.php?lingua=$2&parametro1=$3&parametro2=$4
	#RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ $1.php?lingua=$2&parametro1=$3&parametro2=$4&parametro3=$5
	#RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ $1.php?lingua=$2&parametro1=$3&parametro2=$4&parametro3=$5&parametro4=$6
	
	# 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\.mesaofrio-guimaraes\.com$ [NC]  
   RewriteRule .? http://www.mesaofrio-guimaraes.com%{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>
########################################################################################################