From: Florent G. <li...@fg...> - 2013-10-31 17:29:24
|
"wol...@ex..." wrote: Hi Wolfgang, >> The same applies to the default CSS file, that ./templates/page.html >> refers to as "resources/css/style.css". But depending what page >> applies that template, it might need "../" in front of it. > One approach: catch all paths matching „resources/..“ in the > main controller and redirect them. Here’s some code taken from > the demo apps, which does exactly what you asked for above: Well, not exactly, if I understand correctly it returns links to resources to the client, at any levels (the client sees /resources/my.css as well as /buy/resources/my.css and /sell/resources/my.css), and the rewriting occurs when resolving those URLs when the client ask for them. Rather than presenting the client with the one URL for each resource (which has an impact on caching as well). What I came up with instead, is actually to impose that all "divisions" would be one level down, with one dedicated for home: /home/index.html /buy/index.html /sell/index.html with a redirect from / to /home/index.html. That way, I know that all HTML pages are always at the same depth (and so the root is always at "../"). Thanks for the tip to access the application root in the URL rewriter though! Regards, -- Florent Georges http://fgeorges.org/ http://h2oconsulting.be/ |