Directory and Location Directives

Directory

Description Define a block of directives to apply to a directory tree
Synopsis

...
Context Default server, Virtual host
Example

    AuthType Digest
    AuthName "Acme Inc."
    Require valid-user
The Directory directive defines a block of directives that apply to the named directory and all sub-directories and files. The directoryPath is the full path to the directory. Unlike Apache, it may not contain wildcards.

Inside the directory block, you may use any directive that supports a Directory context. You may not nest Directory directives inside other Directory blocks. But you may use Directory blocks inside VirtualHost blocks.

The difference between the Directory and Location directives is that while the Directory directive applies to files in the file system, the Location directive applies to the URLs before they are mapped to file names.

DirectoryIndex

Description Define the default index file to serve for directory requests
Synopsis
DirectoryIndex document
Context Default Server, Virtual host, Directory
Example
DirectoryIndex index.php
The DirectoryIndex directive specifies the document that will be served when a HTTP request is made for the index of a directory. A browser requests a directory index by issuing a request with a trailing "/" in the URL.

For example: if a DirectoryIndex of "index.php" is specified and a user requestes http://www.acme.com/products/. Then the document /products/index.php will be returned to the user.

NOTE: Unlike Apache, only one document may be specified in the DirectoryIndex directive. Also, only one DirectoryIndex directive may appear per context.

Location

Description Define a block of directives to apply to a URL
Synopsis
...

Context Default server, VirtualHost
Example

    AddHandler myDebugHandler

The Location directive defines a block of directives that apply to the given URL and all URLs that begin with that URL prefix. Location directives are mainly used to associate Handlers with URLs.

The main difference between the Directory and Location directives is that while the Directory directive applies to files in the file system, the Location directive applies to the URLs before they are mapped to file names.

 

© Mbedthis Software LLC, 2003-2204. All rights reserved. Mbedthis is a trademark of Mbedthis Software LLC.