RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^([^/]*)\.html?$ index.php?pg=$1
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^([^/]*)/([^/]*)\.html?$ index.php?pg=$1&sub1=$2
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html?$ index.php?pg=$1&sub1=$2&sub2=$3

# Ensure www on all URLs.
RewriteCond %{HTTP_HOST} ^jsengenhariars.com.br [NC]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ https://www.jsengenhariars.com.br/$1 [L,R=301]

ErrorDocument 404 /404.html

# Can also do the same for other errors...
ErrorDocument 500 /404.html

<ifModule mod_deflate.c>
	<filesMatch "\.(js|css|html|php)$">
		AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
	</filesMatch>
</ifModule>

# php -- BEGIN cPanel-generated handler, do not edit
# Defina o pacote “ea-php56” como a linguagem padrão de programação “PHP”.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
