Generador de .htaccess
Genera reglas .htaccess para redirecciones, protección con contraseña y caché
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>Sigue explorando
Otras herramientas de Desarrollo que te pueden gustar…
Formateador JSON
Formatea, valida y minifica JSON con resaltado de sintaxis y detección de errores
Codificador/Decodificador Base64
Codifica texto o archivos a Base64 y decodifica cadenas Base64 a texto legible
Codificador/Decodificador de URL
Codifica y decodifica componentes URL y parámetros de query string
Generador de UUID
Genera UUIDs aleatorios (v1, v4) o genera múltiples UUIDs en lote
Generador de Hash
Genera hashes MD5, SHA-1, SHA-256, SHA-512 desde texto o archivos
Tester de Regex
Prueba expresiones regulares con resaltado de coincidencias en tiempo real
Decodificador JWT
Decodifica e inspecciona JSON Web Tokens — ve header, payload y verifica firmas
Formateador HTML
Formatea y embellece código HTML con indentación correcta y resaltado de sintaxis