Gerador de .htaccess
Gere regras .htaccess para redirecionamentos, proteção por senha e cache
Configuration Options
Force HTTPS
Redirect all HTTP traffic to HTTPS using mod_rewrite
Force www
Redirect non-www requests to www subdomain
Redirect URL
Enable GZIP Compression
Compress HTML, CSS, JS, and other text responses with mod_deflate
Browser Caching
Set cache expiry for images (1 month) and CSS/JS (1 week)
Block File Types
Comma-separated extensions to deny access to (e.g. log, bak, sql)
Custom 404 Page
Protect .htaccess
Deny direct HTTP access to the .htaccess file itself
.htaccess Output
# Force HTTPS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
# Enable GZIP Compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>
# Browser Caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/webp "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType text/css "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/html "access plus 1 hour"
</IfModule>
# Custom 404 Page
ErrorDocument 404 /404.html
# Protect .htaccess
<Files .htaccess>
Order Allow,Deny
Deny from all
</Files>Continue explorando
Outras ferramentas de Desenvolvimento que você pode gostar…
Formatador JSON
Formate, valide e minifique JSON com destaque de sintaxe e detecção de erros
Codificador/Decodificador Base64
Codifique texto ou arquivos em Base64 e decodifique strings Base64 em texto legível
Codificador/Decodificador de URL
Codifique e decodifique componentes de URL e parâmetros de query string
Gerador de UUID
Gere UUIDs aleatórios (v1, v4) ou gere múltiplos UUIDs em lote
Gerador de Hash
Gere hashes MD5, SHA-1, SHA-256, SHA-512 de texto ou arquivos
Testador de Regex
Teste expressões regulares com destaque de correspondências em tempo real
Decodificador JWT
Decodifique e inspecione JSON Web Tokens — header, payload e assinaturas
Formatador HTML
Formate e embeleze código HTML com indentação correta e destaque de sintaxe