#Action application/x-hg-php53 /cgi-sys/php53
#AddHandler application/x-hg-php53 .php

DirectoryIndex index.html index.htm default.htm index.php index.php3 index.phtml index.php5 index.shtml mwindex.phtml

#Configurao

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)\/?$ cidade.php?ename=$1
RewriteRule ^(.*)/dia\/?$ index.php 
RewriteRule ^(.*)auth/(.*)\/?$ index.php?page=autenticacao 
RewriteRule ^busca_veiculos/?$ index.php?page=busca_veiculos&%{QUERY_STRING}
RewriteRule ^busca_servicos/?$ index.php?page=busca_servicos [L]
RewriteRule ^noticias-veiculos/?$ index.php?page-template=revista&idcategoria=$2  [L]  

RewriteRule ^(.*)revista/(.*)\/?$ index.php?page-template=revista&idcategoria=$2
RewriteRule ^(.*)noticias-veiculos-artigo/(.*)\/?$ index.php?page=revista_artigo&id=$2
RewriteRule ^(.*)veiculos/(.*)\/?$ index.php?page=detalhe_anuncio&id=$2 
RewriteRule ^(.*)servico/(.*)\/?$ index.php?page=detalhe_anuncio&idservico=$2 
RewriteRule ^(.*)page/(.*)\/?$ index.php?page=pagina&pagina=1&idpagina=$2 

RewriteRule ^(.*)auth$ index.php?page=autenticacao 
RewriteRule ^(.)servicos$ index.php?page=services
RewriteRule ^(.*)planosservicos$ index.php?page=planos_servico
#RewriteRule ^(.*)revista/(.*)\/?$ index.php?idartigo=$2
RewriteRule ^(.*)revista/(.*)\/?$ index.php?page=revista&id=$2 
RewriteRule ^(.*)printoffer/(.*)\/?$ index.php?idprint=$2  
RewriteRule ^(.*)convite/(.*)\/?$ convite.php?idusuariopai=$2
RewriteRule ^(.*)carrinho/(.*)\/?$ index.php?page=carrinho&id=$2 
RewriteRule ^(.*)cartpontos/(.*)\/?$ index.php?page=cartpontos&id=$2 
RewriteRule ^(.*)/ofertas/(.*)\/?$ index.php?idcidade=$2 
RewriteRule ^(.*)/estado/(.*)\/?$ index.php?uf=$2  
RewriteRule ^(.*)/Categoria/(.*)\/?$ index.php?page=recentes&idcategoria=$2 
RewriteRule ^(.*)/ofertas/recentes\/?$ index.php?page=recentes
RewriteRule ^cadastro$ index.php?acao=cadastro
RewriteRule ^account/$ index.php?page=meusdados
RewriteRule ^pedidos$ index.php?page=minhaconta
RewriteRule ^planos$ index.php?page=planos
RewriteRule ^planos/(.*)\/?$ index.php?page=planos&tipo=$1 
RewriteRule ^meusconvites$ index.php?page=meusconvites
RewriteRule ^logar$ app/design/padrao/logar.php
RewriteRule ^sair$ autenticacao/logout.php
RewriteRule ^sairanunciante$ autenticacao/logoutanunciante.php
RewriteRule ^cupons$ index.php?page=meuscupons
RewriteRule ^cadastrar$ index.php?page=autentica&acao=cadastro 
RewriteRule ^contato$ index.php?page=contato
RewriteRule ^revendas$ index.php?page=revendas
RewriteRule ^indique$ index.php?page=indique
RewriteRule ^parceiros$ index.php?page=parceiro 
RewriteRule ^enquete$ index.php?page=enquete
RewriteRule ^tabelafipe$ index.php?page=fipe
RewriteRule ^/$ index.php
    
#Fora a utilizar Cache-Control e Expires header
<IfModule mod_headers.c>
  Header unset ETag
</IfModule>
FileETag None
<IfModule mod_expires.c>
 ExpiresActive on
 ExpiresDefault "access plus 1 month"
 ExpiresByType text/cache-manifest "access plus 0 seconds"
 # Html
 ExpiresByType text/html "access plus 0 seconds"
 # Data
 ExpiresByType text/xml "access plus 0 seconds"
 ExpiresByType application/xml "access plus 0 seconds"
 ExpiresByType application/json "access plus 0 seconds"
 # Feed
 ExpiresByType application/rss+xml "access plus 1 hour"
 ExpiresByType application/atom+xml "access plus 1 hour"
 # Favicon
 ExpiresByType image/x-icon "access plus 1 week"
 # Media: images, video, audio
 ExpiresByType image/gif "access plus 1 month"
 ExpiresByType image/png "access plus 1 month"
 ExpiresByType image/jpg "access plus 1 month"
 ExpiresByType image/jpeg "access plus 1 month"
 ExpiresByType video/ogg "access plus 1 month"
 ExpiresByType audio/ogg "access plus 1 month"
 ExpiresByType video/mp4 "access plus 1 month"
 ExpiresByType video/webm "access plus 1 month"
 # HTC files
 ExpiresByType text/x-component "access plus 1 month"
 # Webfonts
 ExpiresByType application/x-font-ttf "access plus 1 month"
 ExpiresByType font/opentype "access plus 1 month"
 ExpiresByType application/x-font-woff "access plus 1 month"
 ExpiresByType image/svg+xml "access plus 1 month"
 ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
 # CSS / JS
 ExpiresByType text/css "access plus 1 year"
 ExpiresByType application/javascript "access plus 1 year"
 ExpiresByType application/x-javascript  "access plus 1 year"
</IfModule>
#Fora o IE a sempre carregar utilizando a ltima verso disponvel
<IfModule mod_headers.c>
  Header set X-UA-Compatible "IE=Edge,chrome=1"
  <FilesMatch "\.(js|css|gif|png|jpeg|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|oex|xpi|safariextz|vcf)$" >
    Header unset X-UA-Compatible
  </FilesMatch>
</IfModule>

<Files ^(*.jpeg|*.jpg|*.png|*.gif)> 
   order deny,allow 
   deny from all 
</Files>

<FilesMatch "\.(ttf|ttc|otf|eot|woff)$">
    <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "*"
    </IfModule>
</FilesMatch>


#php_flag display_startup_errors on
#php_flag display_errors on
#php_flag html_errors on
#php_flag  log_errors on 


#RewriteEngine On 
#RewriteCond %{SERVER_PORT} 80 
#RewriteRule ^(.*)$ https://www.dominio.com.br/$1 [R,L]
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]


# REDIRECIONAR_HTTPS

RewriteEngine On
 
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
