Web Utilities

.htaccess Redirect Generator

301 and 302 Apache redirect rules

About the .htaccess Redirect Generator

Free .htaccess redirect generator for Apache hosts. Build 301 or 302 RewriteRule lines from an old path to a new URL, with an optional HTTPS and www sample block.

How to use the .htaccess Redirect Generator

  1. Enter the old path and the destination URL or path.
  2. Choose 301 for permanent moves or 302 for temporary ones.
  3. Copy the rules into .htaccess and test on staging first.

What to check

WordPress and some hosts manage redirects elsewhere. Avoid duplicate rules that fight each other.

When should I use 301 vs 302?

Use 301 when the move is permanent and you want search engines to transfer signals. Use 302 for short-term tests.

Will this work on Nginx?

No. These rules are for Apache .htaccess. Nginx needs server-block rewrite syntax instead.

Test on staging. Hosting panels sometimes override .htaccess behaviour.