# ----------------------------------------
# Desabilita listagem de diretório
# ----------------------------------------
Options +FollowSymlinks
RewriteEngine On

# ----------------------------------------
# Rediorecionamento para a página de erro
# ----------------------------------------
# Redireciona para index caso seja qualquer uma dessas extensões

# Redireciona para a página de erro caso não seja imagem e não exista o arquivo

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}\.php !-f
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
#RewriteRule ^(.*) /erro.php?pagina_erro=$1 [R=301,L]
#RewriteRule ^(.*) http://localhost/Yaslip/Sitebase/sitebase_sistema_201603211020/erro.php?pagina_erro=$1 [R=301,L]

RewriteEngine on
Redirect 301 /site https://www.smixveiculosespeciais.com.br/

# ----------------------------------------
# Rediorecionamento www
# ----------------------------------------
RewriteCond %{HTTP_HOST} !^www.
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301]


RewriteCond %{http_host} ^smixveiculosespeciais.com.br [NC]
RewriteRule ^(.*)$ https://www.smixveiculosespeciais.com.br/$1 [R=301,L]


# ----------------------------------------
# remover /index.php da URL
# ----------------------------------------
# RewriteRule ^index.php$ / [r=301,NC,L]

# ----------------------------------------
# Rediorecionamento https (SSL)
# ----------------------------------------
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# ----------------------------------------
# URL Amigável
# ----------------------------------------
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
RewriteRule ^(.*)$ $1.php


# ----------------------------------------
# Compactar arquivos automaticamente
# ----------------------------------------

AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript image/jpeg image/png image/gif


# ----------------------------------------
# #Cria cache para melhorar o PageSpeed
# ----------------------------------------

Header unset ETag

FileETag None

ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType text/cache-manifest "access plus 1 hour"
ExpiresByType text/html "access plus 1 hour"
ExpiresByType text/xml "access plus 1 hour"
ExpiresByType application/xml "access plus 1 hour"
ExpiresByType application/json "access plus 1 hour"
ExpiresByType application/rss+xml "access plus 1 month"
ExpiresByType application/atom+xml "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 month"
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"
ExpiresByType text/x-component "access plus 1 month"
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"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"


# php -- BEGIN cPanel-generated handler, do not edit
# Defina o pacote “ea-php74” como a linguagem padrão de programação “PHP”.

AddHandler application/x-httpd-ea-php74___lsphp .php .php7 .phtml

# php -- END cPanel-generated handler, do not edit