## RedirectMatch

Syntax: RedirectMatch [status] regex url
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Status: Base
Module: mod_alias
Compatibility: Available in Apache 1.3 and later

This directive is equivalent to Redirect, but makes use of standard regular expressions, instead of simple prefix matching. The supplied regular expression is matched against the URL, and if it matches, the server will substitute any parenthesized matches into the given string and use it as a filename. For example, to redirect all GIF files to like-named JPEG files on another server, one might use:

        RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg