.htaccess Generator
Pick only the options you need and your .htaccess is written instantly.
Your text and files never leave your browser — nothing is sent to a server.
Save this as .htaccess in your site root (often public_html). Back up any existing file before uploading.
How to use
- Choose what you need on the left. Only options you tick or fill in are added to the file on the right.
- Moved pages? List them under “Old URL → new URL”, one “/old-path /new-path” per line. They become 301 (permanent) redirects so search rankings carry over.
- Lines in the wrong format are flagged in red below the output and left out of the file.
- Copy or download the result and upload it to your site root as .htaccess. Afterwards, check that your key pages still load.
FAQ
Force HTTPS causes an infinite redirect loop.
Behind a proxy or load balancer such as Cloudflare, the server sees every request as plain http, so %{HTTPS} is always off. Use RewriteCond %{HTTP:X-Forwarded-Proto} !https instead, or turn on HTTPS redirects at the proxy.
The downloaded file lost its leading dot.
Some browsers and operating systems rename files that start with a dot. Just rename it to .htaccess when you upload it.
Does this work on Nginx?
No. Only Apache (and compatible servers like LiteSpeed) read .htaccess. On Nginx, the same rules have to be written into the server configuration.
Related tools
All tools
Unit Converters
- Unit Converter
- Temperature Converter
- Weight Converter
- Area Converter
- Length Converter
- Angle Converter
- Calorie Converter
- Data Size Converter
- Dry Volume Converter
- Electric Charge Converter
- Energy Converter
- Flow Rate Converter
- Force Converter
- Fuel Economy Converter
- Luminous Intensity Converter
- Magnetomotive Force Converter
- Power Converter
- Pressure Converter
- Radiation Dose Converter
- Speed Converter
- Time Unit Converter
- Volume Converter