htaccess Generator
Professional htaccess Generator
Basic Settings
Performance
Hotlink Protection
Custom Error Pages
Block IP Addresses
Redirects
.htaccess
# Generated by OnDevTools.com
# https://ondevtools.com/en/htaccess-generator
# Follow Symbolic Links
Options +FollowSymLinks
# Disable Directory Listing
Options -Indexes
# Default Charset
AddDefaultCharset UTF-8
# Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Security Headers
<IfModule mod_headers.c>
Header set X-Content-Type-Options "nosniff"
Header set X-Frame-Options "SAMEORIGIN"
Header set X-XSS-Protection "1; mode=block"
Header set Referrer-Policy "strict-origin-when-cross-origin"
Header set Permissions-Policy "camera=(), microphone=(), geolocation=()"
</IfModule>
# Gzip Compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml
AddOutputFilterByType DEFLATE text/css text/javascript application/javascript
AddOutputFilterByType DEFLATE application/json application/xml
AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>
# Browser Caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 2592000 seconds"
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType font/woff2 "access plus 1 year"
</IfModule>
htaccess Generator
Professional htaccess Generator
Features
- Fast, browser-based htaccess generator with instant results
- No registration or installation required — works directly in your browser
- 100% private — no data is sent to any server
- Works on all modern browsers including mobile devices
How to use
- Enter your input data in the provided field.
- Configure any options as needed.
- View the results instantly and copy or download the output.
Tips & Best Practices
- All processing happens in your browser — no data sent to servers.
- Use the copy button for quick clipboard transfer.
- Works offline once loaded.
- Check the FAQ section for common questions.
- Share this tool with colleagues using the social buttons.
FAQ
Is this tool free to use?
Yes, completely free with no registration, no limits, and no hidden costs.
Is my data private?
All processing happens in your browser. No data is ever sent to any server or third party.
Does it work offline?
Once loaded, the tool works entirely offline. All processing is done client-side with JavaScript.
Which browsers are supported?
Works in Chrome, Firefox, Safari, Edge, and all modern browsers on desktop and mobile.
Can I use the results commercially?
Yes, all output is yours to use freely in any personal or commercial project without restrictions.