The index of a directory can come from one of two sources:
index.html. The The two functions are separated so that you can completely remove (or replace) automatic index generation should you want to.
A "trailing slash" redirect is issued when the server
receives a request for a URL
http://servername/foo/dirname where
dirname is a directory. Directories require a
trailing slash, so http://servername/foo/dirname/.
The Indexes option is
set, the server will generate its own listing of the
directory.
then a request for http://myserver/docs/ would
return http://myserver/docs/index.html if it
exists, or would list the directory if it did not.
Note that the documents do not need to be relative to the directory;
would cause the CGI script /cgi-bin/index.pl to be
executed if neither index.html or index.txt
existed in a directory.
A single argument of "disabled" prevents
The
Typically if a user requests a resource without a trailing slash, which
points to a directory,
If you don't want this effect and the reasons above don't apply to you, you can turn off the redirect as shown below. However, be aware that there are possible security implications to doing this.
Turning off the trailing slash redirect may result in an information
disclosure. Consider a situation where Options +Indexes) and index.html) and there's no other special handler defined for
that URL. In this case a request with a trailing slash would show the
index.html file. But a request without trailing slash
would list the directory contents.
Use this to set a handler for any URL that doesn't map to anything in your filesystem, and would otherwise return HTTP 404 (Not Found). For example
FallbackResource /not-404.php
will cause requests for non-existent files to be handled by
not-404.php, while requests for files that exist
are unaffected.
It is frequently desirable to have a single file or resource handle all requests to a particular directory, except those requests that correspond to an existing file or script. This is often referred to as a 'front controller.'
In earlier versions of httpd, this effect typically required
-f and
-d tests for file and directory existence. This now
requires only one line of configuration.
FallbackResource /index.php
Existing files, such as images, css files, and so on, will be served normally.
In a sub-URI, such as http://example.com/blog/ this sub-URI has to be supplied as local-url:
<Directory /web/example.com/htdocs/blog>
FallbackResource /blog/index.php
</Directory>