Htaccess Redirect Generator
Make correct .htaccess redirect rules without learning mod_rewrite. 301 page redirects, bulk lists, domain moves, HTTPS, www and clean URLs — ready to copy and paste.
1. What do you want to redirect?
2. Fill in the details
Paste it at the top of the .htaccess file in your site's root folder (above # BEGIN WordPress if you use WordPress). Always keep a backup.
Generated in your browser — nothing is uploaded. Works on Apache, LiteSpeed and OpenLiteSpeed.
How to Create .htaccess Redirects
Three steps to working redirect rules.
Choose the Redirect
Pick a single page, a bulk list, a domain move, HTTPS, www, a folder or clean URLs.
Fill in the Details
Enter the old and new addresses. The code updates as you type.
Copy into .htaccess
Paste the code at the top of the .htaccess file in your website's root folder, then test the old URL.
Redirects
8 common types
Bulk
Hundreds of URLs at once
SEO
301 permanent by default
Works on
Apache, LiteSpeed, OpenLiteSpeed
Privacy
Runs in your browser
Price
100% free
Which Redirect Code Should I Use?
Pick the right status code — it tells browsers and Google how to treat the move.
| Code | Meaning | Use it for |
|---|---|---|
| 301 | Moved permanently | Changed URLs, new domain, HTTPS, www — passes SEO value to the new page |
| 302 | Found (temporary) | Short-term moves, sales or maintenance pages |
| 307 | Temporary, keeps the method | Temporary moves of forms or APIs (POST stays POST) |
| 308 | Permanent, keeps the method | Permanent moves of forms or APIs |
[L] flag | Last rule | Stops checking more rules after this one |
[NC] flag | No case | Matches upper and lower case the same |
What Can You Use It For?
Popular ways people use Htaccess Redirect Generator.
Site Migration
Move to a new domain without losing traffic or rankings.
HTTPS Everywhere
Send every visitor to the secure https:// version.
Fix Broken Links
Redirect deleted or renamed pages to the right new page.
Clean URLs
Remove .html or .php and choose www or non-www for one clear address.
Tips for the Best Result
- Always back up your .htaccess file before changing it — a typo can take the site offline (error 500).
- Use 301 for permanent changes so Google moves the ranking to the new URL.
- Avoid redirect chains (A → B → C). Point old URLs straight to the final page.
-
On WordPress, put your rules above the
# BEGIN WordPressblock. On OpenLiteSpeed, restart the server after editing .htaccess. - Test each old URL afterwards with Is Website Down — it shows the full redirect path.
Frequently Asked Questions
Quick answers about Htaccess Redirect Generator.
A rule in the .htaccess file on Apache or LiteSpeed servers that sends visitors (and search engines) from one address to another automatically.
Choose Single page, enter the old and new address, copy the code and paste it at the top of the .htaccess file in your site's root folder.
In your website's root folder (often public_html or the domain's folder). It starts with a dot, so turn on "show hidden files" in your file manager or FTP app.
Choose Force HTTPS. If your site uses Cloudflare or another proxy, keep "behind Cloudflare or a proxy" ticked to avoid redirect loops.
Choose Old domain → new domain. With "Keep the rest of the path" on, every page goes to the same page on the new domain.
Two rules are sending visitors back and forth — often HTTPS behind Cloudflare with Flexible SSL. Tick the Cloudflare option or set Cloudflare SSL to Full.
No. Nginx doesn't read .htaccess files. These rules work on Apache, LiteSpeed and OpenLiteSpeed.
Yes — 100% free with no sign-up. The code is generated in your browser.
Related Free Tools
Ready to Use Htaccess Redirect Generator?
Scroll up and get your result in seconds. 100% free, no sign-up needed.
Start Now