Apache: create an alias to a directory outside the documentroot

The Alias directive is 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. and are used to enclose a group of directives which will apply only to the named directory and sub-directories of that directory. Any directive which is allowed in a directory context may be used. Directory-path is either the full path to a directory, or a wild-card string.

MultiViews is a per-directory option, meaning it can be set with an Options directive within a section in access.conf. The effect of MultiViews is as follows: if the server receives a request for /www/backbase/test, if /www/backbase has MultiViews enabled, and /www/backbase/test does not exist, then the server reads the directory looking for files named test.*, and effectively fakes up a type map which names all those files, assigning them the same media types and content-encodings it would have if the client had asked for one of them by name. It then chooses the best match to the client’s requirements. For example

Alias /backbase/ "c:/www/backbase/"
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all

Leave a Reply