OhMyCalc

.htaccess Redirect Generator

Build a ready-to-paste Apache .htaccess Redirect rule from a source path, destination URL and 301 or 302 status code.

How to Use the .htaccess Redirect Generator

  1. Enter the source path as it appears after the domain.
  2. Enter the full destination URL including https://.
  3. Pick 301 (permanent) or 302 (temporary).
  4. Click Calculate and paste the generated line into .htaccess.

使用场景

公式

Rule format: Redirect <code> <source> <destination>. 301 = permanent, 302 = temporary.

常见问题

301 or 302 — which one?
Use 301 for permanent URL changes (SEO link equity passes). Use 302 for short-lived redirects such as A/B tests or maintenance.
Where does this rule go?
In the .htaccess file at your site root, or inside a Directory block in httpd.conf. Apache reloads .htaccess on each request, so no restart is needed.
Can I use regex?
The Redirect directive takes literal prefixes only. For regex use RedirectMatch or mod_rewrite\u2019s RewriteRule. This generator sticks to the safer literal form.