Mailing List Archive

Same script with different locations
Folks,

I wanted to know if there was anything wrong with using the same MP2 content handler with multiple Location directives in apache and using $r->location() to determine the script that should be used in forms, redirects etc.

We have someone that insists in having different URL's doing something pretty specific while 75% of everything else is share (auth, profiles etc).

It seems to work fine, whatever URL you come in on you will stay on, but there is just something about doing it that made me want to ask.

TIA!
Re: Same script with different locations [ In reply to ]
On Sunday, May 29, 2011 19:40:59 cfaust-dougot wrote:
> I wanted to know if there was anything wrong with using the same MP2
> content handler with multiple Location directives in apache and using
> $r->location() to determine the script that should be used in forms,
> redirects etc.

Nothing wrong with it. But be careful, the administrator can try to
configure it like:

<Location ~ "(something|special)/">

or

<LocationMatch ...>

I am not 100% sure but I think $r->location will contain "(something|
special)/" in that case.

Torsten Förtsch

--
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net
Re: Same script with different locations [ In reply to ]
Torsten Förtsch wrote:
> On Sunday, May 29, 2011 19:40:59 cfaust-dougot wrote:
>> I wanted to know if there was anything wrong with using the same MP2
>> content handler with multiple Location directives in apache and using
>> $r->location() to determine the script that should be used in forms,
>> redirects etc.
>
> Nothing wrong with it. But be careful, the administrator can try to
> configure it like:
>
> <Location ~ "(something|special)/">
>
> or
>
> <LocationMatch ...>
>
> I am not 100% sure but I think $r->location will contain "(something|
> special)/" in that case.
>
It does, I can confirm.
I had a case today, with something like this :

<FilesMatch "\.thtm$">
SetHandler modperl
PerlResponseHandler blabla
..

and in the handler, with $r->location, I got something like "\\.thtm$"
$r->filename on the other hand gave the full *path* (on disk).