You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ralph Bolton <Ra...@Brokat.com> on 2002/02/05 19:08:59 UTC

Overriding httpd.conf SetHandler in .htaccess doesn't work

Hi,

I'm having trouble overriding SetHandler directives in .htaccess (despite
having an "AllowOverride All" covering the directories concerned). My Apache
1.3.22 (WinNT) httpd.conf (inside a VirtualHost) looks a bit like:

 <Location />
  SetHandler perl-script
  ...
 </Location>

 <Location /ps>
  SetHandler default-handler
 </Location>

...which works fine. In the root, my Perl module is run, and in /ps/* it
isn't and I get normal, default behaviour.

What I would like to do is create /ps/cs/.htaccess that looks like:

	SetHandler perl-script
	...

...to re-enable the Perl module in the /ps/cs directory. This works fine if
I create another <Location>...</Location> section in the httpd.conf file,
but not if I do it in .htaccess (no errors reported either).

I have found that it will work fine in .htaccess so long as I have not
specified any SetHandler on any directory above.

So, it looks as if I can set, but not override the SetHandler in .htaccess.
What am I doing wrong?

Regards,

                    ...Ralph Bolton

Customer Support Engineer
Brokat UK Limited
Irongate House,
Duke's Place, Aldgate,
London. EC3A 7LQ
Tel: +44 (0)207 648 6249
Fax: +44 (0)207 626 0216



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: Overriding httpd.conf SetHandler in .htaccess doesn't work

Posted by Joshua Slive <jo...@slive.ca>.
> From: Ralph Bolton [mailto:Ralph.Bolton@Brokat.com]

>
> I'm having trouble overriding SetHandler directives in .htaccess (despite
> having an "AllowOverride All" covering the directories
> concerned). My Apache
> 1.3.22 (WinNT) httpd.conf (inside a VirtualHost) looks a bit like:
>
>  <Location />
>   SetHandler perl-script
>   ...
>  </Location>
>
>  <Location /ps>
>   SetHandler default-handler
>  </Location>
>
> ...which works fine. In the root, my Perl module is run, and in /ps/* it
> isn't and I get normal, default behaviour.
>
> What I would like to do is create /ps/cs/.htaccess that looks like:
>
> 	SetHandler perl-script
> 	...
>
> ...to re-enable the Perl module in the /ps/cs directory. This
> works fine if
> I create another <Location>...</Location> section in the httpd.conf file,
> but not if I do it in .htaccess (no errors reported either).

This is a rather confusing issue in Apache configuration.  The current docs
are at
http://httpd.apache.org/docs/sections.html
but I know they aren't very clear.

The punchline is that <Location> sections take effect after .htaccess
processing, and therefore override .htaccess processing.  In your case, you
can probably fix the problem by putting your SetHandler in a <Directory>
section in httpd.conf.  Then the .htaccess will override it.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org