.htaccess Redirect Generator
Generate professional Apache .htaccess redirect rules instantly with templates, custom conditions, and status code support. Perfect for HTTP to HTTPS redirects, domain redirects, URL rewriting, and website migrations with comprehensive rule validation and deployment guidance.
Available Templates
Complete Guide: .htaccess Redirect Generator
Everything you need to know about using this tool effectively
The Htaccess Redirect Generator creates Apache .htaccess redirect rules. It supports 301 (permanent) and 302 (temporary) redirects, www/non-www redirects, HTTP/HTTPS enforcement, and custom pattern matching with regex. The tool generates the RewriteRule directives you need. All processing happens in the browser.
This tool builds .htaccess RewriteRule and Redirect directives based on your input. It handles common redirect scenarios and outputs the Apache configuration text.
Redirecting old URLs to new ones
Generate 301 redirect rules for a site migration to preserve SEO link equity.
Enforcing HTTPS
Create rules that redirect all HTTP requests to HTTPS.
Standardizing www vs non-www
Generate redirects to ensure all traffic goes to your preferred domain variant.
Redirecting specific pages
Create redirect rules for individual pages that have moved to new URLs.
Select redirect type
Choose 301 (permanent) or 302 (temporary).
Enter source and destination
Type the old URL path and the new URL path.
Generate
Click Generate. The tool creates the .htaccess rules.
Copy or download
Copy the rules or download them as a .htaccess file.
Use 301 for permanent redirects to preserve SEO value.
Use 302 for temporary redirects during maintenance or A/B testing.
Place redirect rules at the top of your .htaccess file.
Test redirects in a browser before deploying to production.
What is the difference between 301 and 302?
301 is a permanent redirect that tells search engines to transfer link equity to the new URL. 302 is a temporary redirect that preserves the original URL in search results.
Where do I put the .htaccess file?
Place it in the root directory of your Apache website. Apache reads .htaccess files in each directory.
Is my data sent to a server?
No. All generation happens in your browser. Nothing is transmitted.
Does it work with Nginx?
No. .htaccess is Apache-specific. For Nginx, you need to convert the rules to Nginx rewrite directives.
Can I redirect using regex patterns?
Yes. The tool supports RewriteRule with regex patterns for matching URL patterns.