lithium
lithium copied to clipboard
How to set the "base" of the environment/request
How do I set the "base" component of the environment, so that generated URLs are prefixed accordingly?
Consider the following use case:
- A website at example.com (non lithium app)
- Lithium app at portal.example.com
- In the apache vhost settings of example.com, requests to example.com/portal maps to portal.example.com:
ProxyRequests On
ProxyPass /portal/ http://portal.example.com/
ProxyPassReverse /portal/ http://portal.example.com/
ProxyPass /portal http://portal.example.com
ProxyPassReverse /portal http://portal.example.com
Now, when accessing example.com/portal, portal.example.com is served, but front-end assets are attempted to be loaded as:
/css/stylesheets.css
/js/scripts.js
Which result in 404s since they don't exist at the root folder of example.com.
I want to set the "base" such that assets, paths, and URLs are properly prefixed with /portal/
/portal/css/stylesheets.css
/portal/js/scripts.js