Apache · .htaccess · SEO Tool

.htaccess Redirect Generator

Generate error-free Apache redirect rules instantly — 301, 302, bulk, regex, and more.

⚠ Please enter the source URL.
⚠ Please enter the destination URL.
Format: Enter one redirect per line as old-url, new-url (comma-separated).
You can also paste CSV data directly. Lines starting with # are ignored.
⚠ Please enter at least one valid URL pair.

Select a preset redirect scenario. Fill in your domain and generate instantly.

🌐
www → non-www
Remove www prefix permanently
🔗
non-www → www
Add www prefix permanently
🔒
HTTP → HTTPS
Force SSL on all pages
HTTPS + www canonical
Enforce https://www.domain
📂
Add Trailing Slash
Append / to all URLs
✂️
Remove Trailing Slash
Strip / from URL ends
🚀
Old → New Domain
Full domain migration 301
🚫
Custom 404 Page
Set a custom error page
⚠ Please enter your domain.
Regex Mode: Use Apache mod_rewrite patterns with captured groups ($1, $2…) and optional conditions. Supports full PCRE-style patterns.
⚠ Please enter a regex pattern.
⚠ Please enter a destination.

Rules generated successfully!
0 rule(s)
0 lines
301 redirect
Generated .htaccess Code