[Dancer-users] Global app-wide "prefix" settings
Pedro Melo
melo at simplicidade.org
Wed Sep 28 23:58:32 CEST 2011
Hi,
On Wed, Sep 28, 2011 at 8:33 PM, sawyer x <xsawyerx at gmail.com> wrote:
> On Wed, Sep 28, 2011 at 9:22 PM, Assaf Gordon <gordon at cshl.edu> wrote:
>> I understand the apache configuration part, but not the dancer part:
>>
>> In my Dancer/Template-Toolkit file (e.g. "views/layout/main.tt"), I'm
>> still using:
>> <img src="[% request.uri_base %]/images/pic.jpg"/>
>> and
>> <link rel="stylesheet" href="[% request.uri_base %]/css/style.css" />
>>
>> So the link (inside the generated HTML that the user will receive) will
>> contain:
>> http://server.cshl.edu/images/pic.jpg
>> and
>> http://server.cshl.edu/css/style.css
>
> Indeed that's what the users will get. Then they have to run another request
> to the server to retrieve it, and that's when they hit the Alias rule which
> tells the apache "they're asking for /images/ but they actually want
> /app/images".
err... No. Actually, the request.uri_base should be at this point /app1 ...
When Apache proxys the request from /app1/something to dancer, he
rewrites it as /something, and sets one header (I forget which one)
with /app1, and that should be what request.uri_base returns.
I'll setup something like this, and see if I can get it to work
tomorrow morning, I need to sleep now.
Bye,
--
Pedro Melo
@pedromelo
http://www.simplicidade.org/
http://about.me/melo
xmpp:melo at simplicidade.org
mailto:melo at simplicidade.org
More information about the Dancer-users
mailing list