Typical context
- Input
- topic → definition → context
- Expected output
- interpretation → limits → next step
The central topic is htaccess Apache Rewrite Guide, the value is in understanding the correct interpretation, not only repeating a result.
Htaccess Apache Rewrite Guide
This guide covers what really matters in htaccess Apache Rewrite Guide: concepts, context, limits and interpretations that often cause confusion.
The central topic is htaccess Apache Rewrite Guide, the value is in understanding the correct interpretation, not only repeating a result.
Focusing on the button or shortcut without understanding the convention behind the result. The fix usually starts by read the rules, exceptions, compatibility issues and interpretation of the generated data..
In the site's root folder (usually public_html or www) or the specific directory you want to configure. The rules apply to that directory and its subdirectories. The file name is exactly .htaccess, with a leading dot and no extension.
The main point is understanding htaccess Apache Rewrite Guide in the right context instead of treating one isolated value as a complete answer.
A recurring mistake is assuming that two similar syntaxes mean the same thing in every context.
Cross-check htaccess Apache Rewrite Guide with source, conventions, freshness and practical goals before taking action.
# .htaccess gerado por jkit.tools
# Apache 2.4+ · mod_rewrite, mod_headers, mod_deflate, mod_expires
<IfModule mod_rewrite.c>
RewriteEngine On
# Força HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Remove o www
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [L,R=301]
</IfModule>
# Desativa a listagem de diretórios
Options -Indexes
# Protege arquivos sensíveis
<FilesMatch "^\.(htaccess|htpasswd|env|git)">
Require all denied
</FilesMatch>
<IfModule mod_headers.c>
# Cabeçalhos de segurança
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options "SAMEORIGIN"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
</IfModule>
<IfModule mod_deflate.c>
# Compressão Gzip
AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript
AddOutputFilterByType DEFLATE application/javascript application/json application/xml
AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>
<IfModule mod_expires.c>
# Cache do navegador
ExpiresActive On
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType text/html "access plus 0 seconds"
</IfModule>
The file is built entirely in your browser from the options you choose. Nothing is sent to any server.