You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ruben Decrop <ru...@decrop.net> on 2005/04/26 07:37:52 UTC

[users@httpd] DirectoryIndex and SetHandler

I've have a small configuration issue with the simultaneous use of
DirectoryIndex and SetHandler

I have a DirectoryIndex defined as such

<Directory /usr/www/dir>
  DirectoryIndex home
</Driectory>

When I define a handler as below, with a SetHandler in a Location
directive pointing to the same  directory,

<Location /dir>
  SetHandler myhandler
</Location>
<Location /dir/image>
  SetHandler None
</Location>


myhandler is being applied as '/dir' instead of '/dir/home', as I hoped
it would.  How can I change the configuration so myhandler is applied as
'/dir/home'
while making sure that for '/dir/image' myhandler is not being applied

Greetings

Ruben


---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] DirectoryIndex and SetHandler

Posted by Ruben Decrop <ru...@decrop.net>.
Just found a solution.  The trick is to use a reg exp that excludes a 
plain 'dir'

Here is the config part

<Directory /usr/www/dir>
  DirectoryIndex home
</Directory>

<Location ~ ^/dir/.+$>
  SetHandler mod_python
  ...
</Location>

Ruben

Joshua Slive wrote:

>On 4/27/05, Ruben Decrop <ru...@decrop.net> wrote:
>  
>
>>The file 'home' exists in the right directory and is returned if the
>>SetHandler is not active.  So I assume the DirectoryIndex is set correctly
>>
>>I am running mod_python which uses the myghty handler (www.myghty.org).
>>The handler runs without issues for all  /dir/* files.  I would like
>>that the handler is applied for  '/dir/home' when the browser is
>>requesting http://host/dir
>>    
>>
>
>I haven't looked into these issues in a while, so I can't remember for
>sure.  But my guess is that it is the handler that is responsible for
>determining whether it handles "virtual" locations (like the directory
>without the file) or whether it insists on having a filename.
>
>You could probably get around the problem by putting your SetHandler
>into a <Files *>.
>
>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
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] DirectoryIndex and SetHandler

Posted by Joshua Slive <js...@gmail.com>.
On 4/27/05, Ruben Decrop <ru...@decrop.net> wrote:
> The file 'home' exists in the right directory and is returned if the
> SetHandler is not active.  So I assume the DirectoryIndex is set correctly
> 
> I am running mod_python which uses the myghty handler (www.myghty.org).
> The handler runs without issues for all  /dir/* files.  I would like
> that the handler is applied for  '/dir/home' when the browser is
> requesting http://host/dir

I haven't looked into these issues in a while, so I can't remember for
sure.  But my guess is that it is the handler that is responsible for
determining whether it handles "virtual" locations (like the directory
without the file) or whether it insists on having a filename.

You could probably get around the problem by putting your SetHandler
into a <Files *>.

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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] DirectoryIndex and SetHandler

Posted by Ruben Decrop <ru...@decrop.net>.
The file 'home' exists in the right directory and is returned if the 
SetHandler is not active.  So I assume the DirectoryIndex is set correctly

I am running mod_python which uses the myghty handler (www.myghty.org).  
The handler runs without issues for all  /dir/* files.  I would like 
that the handler is applied for  '/dir/home' when the browser is 
requesting http://host/dir

Ruben

Joshua Slive wrote:

>On 4/26/05, Ruben Decrop <ru...@decrop.net> wrote:
>  
>
>>I've have a small configuration issue with the simultaneous use of
>>DirectoryIndex and SetHandler
>>
>>I have a DirectoryIndex defined as such
>>
>><Directory /usr/www/dir>
>>  DirectoryIndex home
>></Driectory>
>>
>>When I define a handler as below, with a SetHandler in a Location
>>directive pointing to the same  directory,
>>
>><Location /dir>
>>  SetHandler myhandler
>></Location>
>><Location /dir/image>
>>  SetHandler None
>></Location>
>>
>>myhandler is being applied as '/dir' instead of '/dir/home', as I hoped
>>it would.  How can I change the configuration so myhandler is applied as
>>'/dir/home'
>>while making sure that for '/dir/image' myhandler is not being applied
>>    
>>
>
>How exactly are you defining your handler?  What does it do?
>
>Does the file "home" actually exist?
>
>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
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] DirectoryIndex and SetHandler

Posted by Joshua Slive <js...@gmail.com>.
On 4/26/05, Ruben Decrop <ru...@decrop.net> wrote:
> I've have a small configuration issue with the simultaneous use of
> DirectoryIndex and SetHandler
> 
> I have a DirectoryIndex defined as such
> 
> <Directory /usr/www/dir>
>   DirectoryIndex home
> </Driectory>
> 
> When I define a handler as below, with a SetHandler in a Location
> directive pointing to the same  directory,
> 
> <Location /dir>
>   SetHandler myhandler
> </Location>
> <Location /dir/image>
>   SetHandler None
> </Location>
> 
> myhandler is being applied as '/dir' instead of '/dir/home', as I hoped
> it would.  How can I change the configuration so myhandler is applied as
> '/dir/home'
> while making sure that for '/dir/image' myhandler is not being applied

How exactly are you defining your handler?  What does it do?

Does the file "home" actually exist?

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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org