.htaccess Generator
- Skipped redirect line (use: /old-path /new-path or /old-path https://example.com/new): {line}
- Skipped invalid IP or range: {ip}
- Enter your domain without https://, for example example.com
- Nginx has no .htaccess. These are the matching rules for the options above that Nginx supports; put them inside your server block.
- Nothing selected yet.
- HSTS tells browsers to use HTTPS only. Make sure your whole site works over HTTPS before turning it on.
About this tool
Pick the options you need and get a ready-to-use .htaccess file for Apache hosting (cPanel and most shared hosts), with the matching Nginx rules where they exist. Upload it to your site's root folder. Always keep a backup of your current file, because a typo in .htaccess can show a 500 error. Everything runs in your browser.
Frequently asked questions
What is .htaccess Generator?
Build an Apache .htaccess file for redirects, HTTPS, caching, compression and security, with Nginx rules. It is one of the Cloud & DevOps tools on MyCodeTips.
How do I use .htaccess Generator?
Open the tool, enter or paste your input, and the result appears right away. Use the Copy button to copy it.
Is .htaccess Generator free to use?
Yes. It is free to use and does not need an account.
Is my data safe with .htaccess Generator?
Yes. It runs entirely in your browser, so what you enter is never uploaded to our servers.
Can I share my result?
Yes. Use the share buttons below the tool to post a link or copy a link to the tool page.
Which tools are related to .htaccess Generator?
Nginx Config Generator, HTTP Redirect Checker, CSP Builder & Evaluator.
- Send output to…
- Nothing to send yet.
- Received output from {tool}
- Undo
- Dismiss