.htaccess Redirect Generator
Free online .htaccess redirect generator. Process data instantly in your browser. No upload, no signup, fully private.
How to Use
- Paste or type your text into the .htaccess Redirect Generator input area above.
- Configure any format or mode options to generate the result in real time.
- Click Copy to copy the formatted result to your clipboard, or Reset to clear the workbench.
What is .htaccess Redirect Generator?
An .htaccess Redirect Generator creates Apache web server rewrite and redirect rules for moving old URLs, enforcing canonical www or non-www hostnames, and upgrading HTTP traffic to HTTPS. Webmasters on Apache or cPanel hosting use it to avoid syntax mistakes that can trigger 500 Internal Server Errors or redirect loops.
How It Works
Select one of four modes (Single URL → URL, Force www, Force non-www, or Force HTTPS), fill in the validated path (must start with /) or domain (^[a-z0-9.-]+$), and pick an HTTP status code (301, 302, 307, or 308 for single-URL redirects). buildHtaccess() emits a RewriteEngine On block containing the exact Redirect or RewriteCond/RewriteRule directives locally.
Common Use Cases
- Migrating changed page URLs — generate permanent Redirect 301 /old-page /new-page rules to preserve search equity
- Enforcing HTTPS sitewide — copy RewriteCond %{HTTPS} off with [L,R=301] to redirect insecure requests
- Standardizing www vs. apex domains — prevent duplicate-host indexing with validated Apache HTTP_HOST rules
- Preserving POST request methods during moves — select 307 (temporary) or 308 (permanent) status codes
Technical Details
Modes: single (Redirect 301|302|307|308 <from> <to>), www, no-www, and https (RewriteEngine On + RewriteCond/RewriteRule [L,R=301]). Validates leading / on source path and [a-z0-9.-]+ on domain locally.
FAQ
Is this .htaccess Redirect Generator free?
Yes, completely free. No signup required.
Does this tool upload my data?
No. All processing happens locally in your browser. Your data never leaves your device.