Generally a file path used in an Apache configuration file represents the file path from the root-directory (
/) of the machine. However, you may be puzzled when you see a file path in an
Alias directive. To understand why the first argument in an
Alias directive breaks this rule you need to know what an
Alias directive is saying.
Look at the following configuration snippet:
Alias /phpMyAdmin /usr/local/phpMyAdmin <Directory /usr/local/phpMyAdmin> Options Indexes Order allow,deny Allow from all </Directory>
Alias directive above tells the web server:
“Mr. Web server. If you see /phpMyAdmin after the FQDN in an HTTP request then I want you to serve-up the index page in the
/usr/local/phpMyAdmin directory of the machine.”
The Apache documentation says:
Apache Module mod_alias
The directives contained in this module allow for manipulation and control of URLs as requests arrive at the server. The Alias and ScriptAlias directives are used to map between URLs and filesystem paths. This allows for content which is not directly under the DocumentRoot served as part of the web document tree.
The Redirect directives are used to instruct clients to make a new request with a different URL. They are often used when a resource has moved to a new location.
mod_alias is designed to handle simple URL manipulation tasks. For more complicated tasks such as manipulating the query string, use the tools provided by mod_rewrite.