I have a DNS A record I want my app to be forwarded to. I have added to $EXIST_HOME/webapp/WEB-INF/controller-config.xml
this line:
<root server-name="something.mydomain.com" pattern=".*" path="xmldb:exist:///db/apps/myapp"/>
This is what I have in my controller.xql regarding app-root:
else if (contains($exist:path,"app-root")) then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{$exist:controller}/{substring-after($exist:path, '$app-root/')}">
<set-header name='Cache-Control' value="no"/>
</forward>
</dispatch>
Now when I point my browser to something.mydomain.com I correctly see db/apps/myapp content (still working out how to get the index.html within that folder to kick in, but that's a secondary issue). something.mydomain.com/index.html transforms into 'http://something.mydomain.com/exist/index.html' and I see the page. Nevertheless I have lost all the links to images, CSS style, etc. Upon inspection, I see, for instance, that $app-root doesn't get unpacked (for instance, my banner retains the address '$app-root/resources/img/banner.jpg' in the HTML source of my page in the browser). I have changed that into /resources/img/banner.jpg
, resources/img/banner.jpg
, etc, and I haven't had any luck. Needless to say, it was all working perfectly before changing the $EXIST_HOME/webapp/WEB-INF/controller-config.xml
. What am I missing?
Additional related question:
I haven't found <Set name="contextPath">/exist</Set>
in $EXIST_HOME/tools/jetty/etc/jetty.xml
as instructed in the eXist: A NoSQL Document Database and Application Platform book. Were can I find it, so that I can remove the 'exist' bit of the URL?