UTILS.
Private by default
↪

htaccess Redirect Generator

Generate Apache .htaccess redirect rules from a list of from and to pairs.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →
Each line: source path, then destination URL.
— output appears here —

About this tool

This tool turns a list of old paths and new addresses into Apache Redirect directives ready to paste into a .htaccess file. Choose 301 (permanent) or 302 (temporary), then enter one rule per line: the old path, whitespace, then the destination. Two example lines are pre-filled, and the output updates as you type; the Copy button copies the generated lines.

Each valid line becomes Redirect 301 /old-page https://example.com/new-page. The first word is treated as the source and everything after the first whitespace is joined as the destination. Blank lines are skipped, and a line with only one word is silently ignored rather than reported. The tool does not check that paths or URLs are valid and does not test them against a server.

Keep in mind how Apache's Redirect directive (mod_alias) behaves: it matches by URL-path prefix, so Redirect 301 /old also catches /old-page and appends the rest of the path to the destination, and it cannot match query strings. For those cases you need RewriteRule instead, which this tool does not generate. The text is created in your browser and nothing is uploaded.

Frequently asked questions

When should I use 301 versus 302?
Use 301 when the move is permanent so search engines transfer ranking to the new address and browsers may cache it. Use 302 for temporary moves you plan to reverse.
What format does each line take?
The old path or URL path, whitespace, then the full destination URL, for example /old-page https://example.com/new-page. Lines with fewer than two parts are skipped.
Will these rules match query strings or only exact pages?
Apache's Redirect directive matches by path prefix and ignores query strings, so /old also matches /old-page. For exact matching or query-string rules use mod_rewrite, which this tool does not generate.
Does it upload my redirect list or test the rules?
No. The directives are text generated in your browser; they are not tested or sent anywhere. Check them on your own server before relying on them.

More tools