From: Joshua Slive
DocumentRoot
. URLs with a
(%-decoded) path beginning with url-path will be mapped
- to local files beginning with directory-path.
+ to local files beginning with directory-path. The
+ url-path is case-sensitive, even on case-insenitive
+ file systems.
Alias /image /ftp/pub/image
@@ -180,6 +182,14 @@ expressions
AliasMatch ^/icons(.*) /usr/local/apache/icons$1
It is also possible to construct an alias with case-insensitive + matching of the url-path:
+ +
+ AliasMatch (?i)^/image(.*) /ftp/pub/image$1
+
The Redirect directive maps an old URL into a new one. The - new URL is returned to the client which attempts to fetch it - again with the new address. URL-path a (%-decoded) - path; any requests for documents beginning with this path will - be returned a redirect error to a new (%-encoded) URL beginning - with URL.
+The Redirect directive maps an old URL into a new one by asking + the client to refetch the resource at the new location.
+ +The old URL-path is a case-sensitive (%-decoded) path + beginning with a slash. A relative path is not allowed. The new + URL should be an absolute URL beginning with a scheme and + hostname, but a URL-path beginning with a slash may also be used, + in which case the scheme and hostname of the current server will + be added.
The A request for
Redirect /service http://foo2.bar.com/service
@@ -328,9 +341,9 @@ target as a CGI script
ScriptAlias
directive has the same
behavior as the Alias
directive, except that in addition it marks the target directory
- as containing CGI scripts that will be processed by mod_cgi
's cgi-script handler. URLs with a
+ as containing CGI scripts that will be processed by mod_cgi
's cgi-script handler. URLs with a case-sensitive
(%-decoded) path beginning with URL-path will be mapped
- to scripts beginning with the second argument which is a full
+ to scripts beginning with the second argument, which is a full
pathname in the local filesystem.Example:
@@ -338,8 +351,34 @@ target as a CGI script
http://myserver/cgi-bin/foo
would cause the
- server to run the script /web/cgi-bin/foo
./web/cgi-bin/foo
. This configuration
+ is essentially equivalent to:
+ Alias /cgi-bin/ /web/cgi-bin/
+ <Directory /web/cgi-bin >
+
+ SetHandler cgi-script
+ Options +ExecCGI
+
+ </Directory>
+
DocumentRoot
in order to
+ avoid accidentally revealing their source code if the
+ configuration is ever changed. The
+ ScriptAlias
makes this easy by mapping a
+ URL and designating CGI scripts at the same time. If you do
+ choose to place your CGI scripts in a directory already
+ accessible from the web, do not use
+ ScriptAlias
. Instead, use <Directory>
, SetHandler
, and Options
as shown in the second example
+ above.