PB
Available
swap_horiz
lock Free · Private · In-Browser

Htaccess Redirect Generator

Turn URL mapping pairs into Apache redirect directives with explicit status codes.

 

Generate reviewable Apache redirects

Apache supports redirects through both mod_alias Redirect directives and mod_rewrite RewriteRule patterns. This generator parses one source and destination pair per line, validates the destination as an absolute URL or root-relative path, and emits the selected directive with a chosen 301, 302, 307, or 308 response status. Rewrite output includes the engine declaration and terminal redirect flags.

With the default rewrite input, the old page path is anchored as a rule and its space is escaped, while the blog capture pattern can pass its first group into the article destination. Alias mode instead quotes complete paths and destinations for straightforward literal mappings. Empty sides and invalid destination forms produce explicit errors before any configuration is copied.

Literal paths versus rewrite patterns

RewriteRule sources are regular expressions after the leading slash is removed, so punctuation can carry regex meaning. Use mod_alias for literal paths when captures are unnecessary, and test rules in a staging server because surrounding virtual-host configuration changes behavior. The mapping is transformed locally in your browser. Check redirect loops, query-string requirements, directory context, and module availability before deploying the file.

Frequently Asked Questions

When should I choose Redirect instead of RewriteRule?

Use Redirect for simple literal path mappings; choose RewriteRule when you need anchors, captures, or pattern matching.

Why is the leading slash removed from RewriteRule patterns?

In per-directory htaccess context, Apache matches RewriteRule against a path without the leading slash.

Does the tool test redirects on my server?

No. It generates configuration locally; server modules and surrounding rules must be verified in staging.

Take it further
All Free Tools

Browse the full set of free, private, in-browser tools.

Learn More arrow_forward