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

Assaf Gordon gordon at cshl.edu
Wed Sep 28 20:22:37 CEST 2011


Pedro Melo wrote, On 09/28/2011 02:14 PM:
> Hi,
> 
> On Wed, Sep 28, 2011 at 6:54 PM, Assaf Gordon <gordon at cshl.edu> wrote:
>> What do I need to change in order for the static files to be served from "http://server.cshl.edu/app1/images" instead of "http://server.cshl.edu/images" (which is the way templates will be rendered using "request.uri_base" and "request.uri_for" ?
> 
> Inside the server.cshl.edu Apache VirtualHost configuration block, try this:
> 
> Alias /app1/images /path/to/app1/public/images
> Alias /app2/images /path/to/app2/public/images
> 

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

And so that alias (in the apache configuration) will not 'catch' it.


-gordon



More information about the Dancer-users mailing list