.htaccess Generator
Generate an .htaccess file for Apache: force HTTPS, set redirects, error pages, caching, compression and security headers. Private.
More options
Redirect a page
Error page
.htaccess
Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)
Free Online .htaccess Generator
Choose what your Apache site needs and get a ready .htaccess file: send visitors to HTTPS, redirect old pages, show your own error pages and let browsers cache files. It gives developers a quick browser-based way to solve a focused .htaccess generator task before moving the result into a project.
How to make an .htaccess file
Switch on the options you need. Add redirects and error pages below. Copy the result, or download it and upload it to your site's root folder as .htaccess.
Testing it
Open your site in a private window after uploading. If you get a 500 error, rename the file and check the Apache error log: a module may be missing.
Common mistakes
- Writing redirect loops, such as forcing www and non-www at the same time.
- Forcing HTTPS before a certificate is installed: visitors then see a security error.