Hitachi

Hitachi Application Server V10 Definition Reference Guide (For Windows® Systems)


2.3.27 AliasMatch

AliasMatch uses a regular expression to replace the URL to a file system path.

Description

AliasMatch specifies the new path to replace the URL requested from a web browser. However, you cannot specify anything (query string) after the question mark (?) in URL.

When a URL that satisfies the conditions described with a regular expression is requested from the web browser, the content of the specified new path is displayed in the web browser. When the regular expression in regular_expression is surrounded by parentheses (()), you can specify $n (where n is a number from 1 to 9) which indicate the character string matching the nth regular expression in the regular_expression. For example, $1 indicates the first group, and $2 indicates the second group.

A regular expression that is the same as the following directive value cannot be specified.

For example, the following specification is not possible:

AliasMatch ^/aaa/bbb/(.*) C:/alias/$1
ProxyPass /aaa/ http://aaa.example.com/ 

Specify the new path as an absolute path. In addition, if you want to include a dollar sign ($) or an ampersand (&) in the new path, add a backslash (\) before that character. Note that you do not need to add a backslash before the dollar sign when specifying $i.

Syntax

AliasMatch regular_expression new_path

Locations where it can be written

httpsd.conf and <VirtualHost>

Example

AliasMatch ^/html/(.*) "C:/htdocs/html/$1"

For a request that begins with /html/, the /html/ part is replaced with C:/htdocs/html/. For example, /html/index.html is replaced with C:/htdocs/html/index.html.