.htaccess Redirect Generator

Generate Apache .htaccess redirect rules. Choose 301 (permanent) or 302 (temporary), force HTTPS, and handle www/non-www preferences.

⚠️ Safety Warning: Incorrect .htaccess rules can take down your entire site. Always test redirects on a staging environment first. Make a backup of your existing .htaccess file before making changes. A single syntax error can cause a 500 Internal Server Error.

Redirect Configuration

The path you want to redirect FROM. Can be a relative path or full URL.
The full destination URL.

Global Rules

301 vs 302 Redirects

  • 301 (Permanent): Tells search engines the page has moved permanently. Passes ~90-99% of link equity. Use for permanent URL changes.
  • 302 (Temporary): Tells search engines the move is temporary. Does not pass full link equity. Use for temporary maintenance or A/B testing.

Best Practices

  • Always use 301 redirects for permanent URL changes and site migrations.
  • Redirect to the most relevant page — avoid redirecting everything to the homepage.
  • Keep redirect chains short (ideally 1 hop). Long chains slow down page loads.
  • Test all redirects after deployment using a redirect checker tool.