From: Joshua Slive Date: Tue, 3 May 2005 19:53:21 +0000 (+0000) Subject: Add a little detail about merging of .htaccess with httpd.conf, X-Git-Tag: 2.1.5~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a84c5acdf0e679fab3573958bf272c3dd524bae;p=thirdparty%2Fapache%2Fhttpd.git Add a little detail about merging of .htaccess with httpd.conf, and provide an example to enforce certain settings. PR: 31782 Submitted by: Ray Ferguson , Joshua Slive git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@167970 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/howto/htaccess.html.en b/docs/manual/howto/htaccess.html.en index e6b02f4f343..26333093219 100644 --- a/docs/manual/howto/htaccess.html.en +++ b/docs/manual/howto/htaccess.html.en @@ -239,6 +239,34 @@ changes on a per-directory basis.

permitted, as only Options Includes is in effect, which completely overrides any earlier setting that may have been in place.

+ +

Merging of .htaccess with the main + configuration files

+ +

As discussed in the documentation on Configuration Sections, + .htaccess files can override the <Directory> sections for + the corresponding directory, but will be overriden by other types + of configuration sections from the main configuration files. This + fact can be used to enforce certain configurations, even in the + presence of a liberal AllowOverride setting. For example, to + prevent script execution while allowing anything else to be set in + .htaccess you can use:

+ +

+<Directory />
+ +Allowoverride All
+
+</Directory>
+
+<Location />
+ +Options +IncludesNoExec -ExecCGI
+
+</Location> +

+ +
top

Authentication example

diff --git a/docs/manual/howto/htaccess.xml b/docs/manual/howto/htaccess.xml index 374030cd2de..6978a65cfd7 100644 --- a/docs/manual/howto/htaccess.xml +++ b/docs/manual/howto/htaccess.xml @@ -265,6 +265,37 @@ changes on a per-directory basis.

permitted, as only Options Includes is in effect, which completely overrides any earlier setting that may have been in place.

+ +
Merging of .htaccess with the main + configuration files + +

As discussed in the documentation on Configuration Sections, + .htaccess files can override the Directory sections for + the corresponding directory, but will be overriden by other types + of configuration sections from the main configuration files. This + fact can be used to enforce certain configurations, even in the + presence of a liberal AllowOverride setting. For example, to + prevent script execution while allowing anything else to be set in + .htaccess you can use:

+ + +<Directory />
+ +Allowoverride All
+
+</Directory>
+
+<Location />
+ +Options +IncludesNoExec -ExecCGI
+
+</Location> +
+
+
Authentication example