Tested tool guide
Tested browser tools
Checked August 16, 2026
What .htaccess Redirect Generator does, with a checked example
Takes an old URL path, a destination URL, and a status code, and returns ready-to-paste Apache directives: a mod_alias Redirect line, a mod_rewrite RewriteRule block, or both. It handles the syntax details that routinely break hand-written rules: RewriteEngine On, the [R=301,L] flag pair, and the pattern rules that differ between the two modules. The usual surprise is that Redirect and RewriteRule are not interchangeable: Redirect matches a path prefix and keeps the query string, while RewriteRule matches a regex against the path alone, and the two treat trailing slashes differently.
Worked example
A concrete input and expected output from the current implementation.
Input
Old path: /old-page
Destination: https://example.com/new-page
Status: 301
->
Expected output
Redirect 301 /old-page https://example.com/new-page
RewriteEngine On
RewriteRule ^old-page/?$ https://example.com/new-page [R=301,L]
Both lines are valid Apache syntax for the same move: the Redirect form matches /old-page and everything beneath it, while the RewriteRule matches exactly /old-page with an optional trailing slash. Same status code, two different match scopes.