Generator
.htaccess Redirect Generator
Generate Apache .htaccess redirect rules instantly. Create 301 permanent redirects, 302 temporary redirects, HTTPS enforcement rules, www/non-www redirects, and wildcard patterns — copy-ready for your server.
What gets checked
- 301 permanent and 302 temporary redirects
- Wildcard and pattern-based redirect rules
- Force HTTPS (HTTP to HTTPS redirect)
- www to non-www (and reverse) redirect rules
- Directory redirect rules
- Copy-ready .htaccess snippet output
Global options
Redirect rules
From (path)To (URL)Type
.htaccess
RewriteEngine On
# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Redirect 301
RewriteRule ^old-page$ https://example.com/new-page [L,R=301]Place this code in the .htaccess file in your Apache server's root directory. Use 301 for permanent redirects (SEO equity passes), 302 for temporary redirects.