From: Joshua Slive Date: Sun, 20 Aug 2006 18:20:11 +0000 (+0000) Subject: Backport: X-Git-Tag: 2.0.60~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f673ebb0fcd61645bb5aa7301c83f2a3c6544e0d;p=thirdparty%2Fapache%2Fhttpd.git Backport: Make it clear that url-path is always case-sensitive. Provide an example of using a regex to make it case-insensitive. Make it clear that ScriptAlias is only used when you want BOTH mapping and script-designation. (Plus the description of Redirect) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@432999 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_alias.html.en b/docs/manual/mod/mod_alias.html.en index ea0f2e15fa5..9d65d753bee 100644 --- a/docs/manual/mod/mod_alias.html.en +++ b/docs/manual/mod/mod_alias.html.en @@ -118,7 +118,9 @@ ignored.

be stored in the local filesystem other than under the 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.

Example:

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 +

+ +
top

Redirect Directive

@@ -193,12 +203,15 @@ a different URL Status:Base Module:mod_alias -

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.

Example:

Redirect /service http://foo2.bar.com/service @@ -328,9 +341,9 @@ target as a CGI script

The 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

A request for http://myserver/cgi-bin/foo would cause the - server to run the script /web/cgi-bin/foo.

+ server to run the script /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> +

+
It is safer to avoid placing CGI scripts under the + 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.
+ + +

See also

+
top

ScriptAliasMatch Directive

@@ -371,6 +410,6 @@ and designates the target as a CGI script  ja  |  ko 

\ No newline at end of file diff --git a/docs/manual/mod/mod_alias.xml b/docs/manual/mod/mod_alias.xml index 018a6329a4c..4bc5320416e 100644 --- a/docs/manual/mod/mod_alias.xml +++ b/docs/manual/mod/mod_alias.xml @@ -106,7 +106,9 @@ ignored.

be stored in the local filesystem other than under the 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.

Example: Alias /image /ftp/pub/image @@ -170,6 +172,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 + + @@ -184,12 +194,15 @@ a different URL FileInfo -

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.

Example: Redirect /service http://foo2.bar.com/service @@ -321,9 +334,9 @@ target as a CGI script 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 + >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: @@ -331,8 +344,34 @@ target as a CGI script

A request for http://myserver/cgi-bin/foo would cause the - server to run the script /web/cgi-bin/foo.

+ server to run the script /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> +
+ + It is safer to avoid placing CGI scripts under the + 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. +
+CGI Tutorial