301 Redirect Online Logo

RedirectMatch 301 Redirect Generator

If You have a lot of mod alias redirectmatch 301 redirects and you need to proceed this way to avoid conflicts, here is the generator for  .htaccess to help you with this task. It generates RedirectMach 301 rules for the exact page to page redirection based on corresponding regular expressions. Please, read the notes at the bottom. 

Paste lines with Old and New urls here:

Copy Apache .htaccess mod Alias RedirectMatch rules from here:

Separator between old and new url in a line:

Distinct 301 Redirects for distinct domain names in old urls

Unfortunately, mod Alias Redirectmatch can't check if the request comes for a certain domain name. So, all old domain names will be just stripped. Fortunately, the use of domain name check for 301 redirects is a rare task. To use domain names as condition, please, use .htaccess 301 redirect rewrite generator.

Redirectmatch 301 redirect on special query string condition in old urls

Mod Alias is very strict and fast module, but not too functional. It can't check if certain query sting come. Mod alias redirectmatch 301 will just add old query string to new url. To check query strings, please, use htaccess rewrite rule generator for 301 redirects.

Redirect to url with special query string

Again, no such functionality with Redirect or RedirectMatch. Possible to do it with mod Rewrite. To do such 301 redirects, please, use htaccess rewrite rule generator.

Why not just use "Redirect permanent" or "Redirect 301"?

These rules will redirect whole directories, not just only individual urls. It can result in wrong redirects. This is why this generator uses redirectmatch 301.  It is clear from  mod_alias 301 redirect documentation.