.htaccess Redirect Generator

Your workspaceProcessed on your device

Enter status, exact or prefix, source path and destination per line. Separate fields with spaces or tabs. Rules match case-sensitively and run in line order.

For a document-root .htaccess file. Enable Apache mod_alias and allow the FileInfo override. Prefix rules carry the remaining path to the destination.

Inputs and output stay on this device.

A few things to know.

Supports up to 100 case-sensitive rules using status 301, 302, 307 or 308, plain ASCII source paths and HTTP(S) or same-site destinations. Prefix rules require source and destination paths without trailing slashes. The output targets the document-root .htaccess file. Overlap checks cover the rules you enter.

  1. Enter one rule per line with the status code, exact or prefix, the source path and the destination. Load the example to see both rule types.
  2. Generate the rules. Check line-specific errors, first-match overlaps and destinations that may lead back into the rule set.
  3. Copy the rules into .htaccess or save the htaccess.txt download as .htaccess. Test on Apache with mod_alias enabled and the FileInfo override allowed.