DirectoryIndex and SetHandler

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

DirectoryIndex and SetHandler

Ruben Decrop
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: [hidden email]
   "   from the digest: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: DirectoryIndex and SetHandler

Joshua Slive
On 4/26/05, Ruben Decrop <[hidden email]> 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: [hidden email]
   "   from the digest: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: DirectoryIndex and SetHandler

Ruben Decrop
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 <[hidden email]> 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: [hidden email]
>   "   from the digest: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>
>
>  
>


---------------------------------------------------------------------
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: [hidden email]
   "   from the digest: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: DirectoryIndex and SetHandler

Joshua Slive
On 4/27/05, Ruben Decrop <[hidden email]> 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: [hidden email]
   "   from the digest: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: DirectoryIndex and SetHandler

Ruben Decrop
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 <[hidden email]> 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: [hidden email]
>   "   from the digest: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>
>
>  
>


---------------------------------------------------------------------
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: [hidden email]
   "   from the digest: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...