What a File Path Represents in Apache Configuration

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

The 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.


About samehramzylabib

See About on https://samehramzylabib.wordpress.com
This entry was posted in Configure My Systems. Bookmark the permalink.

One Response to What a File Path Represents in Apache Configuration

  1. Pingback: Lubuntu cont’d – add MySQL & phpMyAdmin | Sam's PHP How-To


Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s