[Dancer-users] Global app-wide "prefix" settings

Brian E. Lozier brian at massassi.com
Wed Sep 28 22:31:42 CEST 2011


On Wed, Sep 28, 2011 at 1:26 PM, sawyer x <xsawyerx at gmail.com> wrote:

> On Wed, Sep 28, 2011 at 11:21 PM, Brian E. Lozier <brian at massassi.com>wrote:
>
>> I think I understand what you're saying but I think you're
>> misunderstanding the problem.  The problem is that he wants to mount TWO
>> apps under different directories:
>>
>
> Indeed perhaps I'm misunderstanding.
>
>>
>> /prefix1/
>> /prefix2/
>>
>> But each of these apps are requesting images like /images/image1.png, and
>> the images overlap.  He wants requests coming from /prefix1/ to service
>> /prefix1/images/image1.png and requests from /prefix2/ to service
>> /prefix2/images/image1.png even though there's no way to tell the server
>> which "prefix" he's under given a request for /images/image1.png.
>>
>
> The solution would still be the same though. It's a server configuration
> problem.
> Put the public directory outside the applications, set up the aliases to
> the same directory.
> "Badaboom", as it were in The Fifth Element. :)
>


"Put an alias from "/myapp/images" to "/public/images""

Except that his HTML is coded such that requests for images are going to
/images/ (please note the beginning "/" -- all requests are going to the
root of the server) not /myapp/images/, so making an alias at /myapp/images/
to /something_else/images/ won't help.

He's trying to use the same URL (http://myserver.com/images/foo.png) to
serve different content based on whether it was requested from an html page
at /prefix1/ or /prefix2/ -- the only way to do this would be for the
request for the image to look at something like the referrer and serve the
"right" image.  Or modify his app to request different URLs and then there
is no problem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20110928/bf8a6f19/attachment.htm>


More information about the Dancer-users mailing list