You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Artem Kuchin <ma...@itlegion.ru> on 2007/03/29 10:46:51 UTC

[users@httpd] Configuring handler for exact location

Hello!

I need to configure a handler which will 
process ONLY  / url.
for example
http://www.domain.dom/ is handled by handler
as well as http://www.domain.dom

but  http://www.domain.dom/images or
http://www.domain.dom/admin is not handled by
the handler (handler is eather cgi script or
mod_perl script)


However, http://www.domain.dom/Proc is also handled
by the same handler.

Why i need it:

This is big mod_perl (or cgi, can run both modes)
which handles all interactive behaviour and page 
fetching.

I also shown the first page, but then all links
point to http://www.domain.dom/Proc/Something

However this is also static data like images.

So, currently here is what i do:
ScriptAlias /Proc "/hosts/domain.dom/cgi-bin/pub/Public"

Public - is the script, which handles all requests for pages.

The i create index.html with SSI command
<!--#include virtual="/Proc" -->

So, when user get the index page it return the default page from the script.

I don't want to use redirect because this was index would not exist at all,
it'll be just a redirect. Bad for SEO.

However this SSI trick sucks too because if i want to set cookies it will not
work from SSI.

This is why i need / uri to be handled by the script, but not the other
dirs (images,admin,jscript,...). Maybe there is a way to set global handles but
list uri exeptions?

I am using Apache 2.1 under freebsd, if it matters.



--
Artem

---------------------------------------------------------------------
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] Configuring handler for exact location

Posted by Joshua Slive <jo...@slive.ca>.
On 3/29/07, Artem Kuchin <ma...@itlegion.ru> wrote:

>
> If i do
>
>     <Location "/">
>         SetHandler perl-script
>         PerlResponseHandler Megalib::Exec::Public
>     </Location>
>
> then /images will be processed by Public handler too, but i need
> only / and /Proc to be processed by handler

Let's see, we changed
ScriptAlias / -> ScriptAliasMatch ^/$
I wonder if we could do
<Location /> -> <LocationMatch ^/$>

(No need to wonder long, just check the docs.)

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] Configuring handler for exact location

Posted by Artem Kuchin <ma...@itlegion.ru>.
Joshua Slive wrote:
> On 3/29/07, Artem Kuchin <ma...@itlegion.ru> wrote:
>> Hello!
>> 
>> I need to configure a handler which will
>> process ONLY  / url.
>> for example
>> http://www.domain.dom/ is handled by handler
>> as well as http://www.domain.dom
>> 
>> but  http://www.domain.dom/images or
>> http://www.domain.dom/admin is not handled by
>> the handler (handler is eather cgi script or
>> mod_perl script)
>> 
>> 
>> However, http://www.domain.dom/Proc is also handled
>> by the same handler.
>> 
>> Why i need it:
>> 
>> This is big mod_perl (or cgi, can run both modes)
>> which handles all interactive behaviour and page
>> fetching.
>> 
>> I also shown the first page, but then all links
>> point to http://www.domain.dom/Proc/Something
>> 
>> However this is also static data like images.
>> 
>> So, currently here is what i do:
>> ScriptAlias /Proc "/hosts/domain.dom/cgi-bin/pub/Public"
>> 
>> Public - is the script, which handles all requests for pages.
>> 
>> The i create index.html with SSI command
>> <!--#include virtual="/Proc" -->
>> 
>> So, when user get the index page it return the default page from the
>> script. 
> 
> You can just use
> ScriptAliasMatch ^/$ "/hosts/domain.dom/cgi-bin/pub/Public"
> 

Well, this is good, but what about mod_perl handler?


Currently i use:

    <Location "/Proc">
        SetHandler perl-script
        PerlResponseHandler Megalib::Exec::Public
    </Location>

If i do

    <Location "/">
        SetHandler perl-script
        PerlResponseHandler Megalib::Exec::Public
    </Location>

then /images will be processed by Public handler too, but i need
only / and /Proc to be processed by handler

--
Regards,
Artem Kuchin


---------------------------------------------------------------------
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] Configuring handler for exact location

Posted by Joshua Slive <jo...@slive.ca>.
On 3/29/07, Artem Kuchin <ma...@itlegion.ru> wrote:
> Hello!
>
> I need to configure a handler which will
> process ONLY  / url.
> for example
> http://www.domain.dom/ is handled by handler
> as well as http://www.domain.dom
>
> but  http://www.domain.dom/images or
> http://www.domain.dom/admin is not handled by
> the handler (handler is eather cgi script or
> mod_perl script)
>
>
> However, http://www.domain.dom/Proc is also handled
> by the same handler.
>
> Why i need it:
>
> This is big mod_perl (or cgi, can run both modes)
> which handles all interactive behaviour and page
> fetching.
>
> I also shown the first page, but then all links
> point to http://www.domain.dom/Proc/Something
>
> However this is also static data like images.
>
> So, currently here is what i do:
> ScriptAlias /Proc "/hosts/domain.dom/cgi-bin/pub/Public"
>
> Public - is the script, which handles all requests for pages.
>
> The i create index.html with SSI command
> <!--#include virtual="/Proc" -->
>
> So, when user get the index page it return the default page from the script.

You can just use
ScriptAliasMatch ^/$ "/hosts/domain.dom/cgi-bin/pub/Public"

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