VHosts and PageUrl

We are having some trouble here with sites mapped to two domains. Do you know why the pageUrl function does not consider the virtualhost config to create urls? What I mean is:
I have an object on the norwegian site (which is the main site) that I have related on the english site. When generating the url with pageUrl, I get “URI out of scope”, but I have config on vhosts that maps the norwegian site to its domain which should generate the url to the mapped domain for it.

1 Like

Sounds like you try to use pageUrl to link across vhosts. As you can apply a dozens of vhosts to a site, pageUrl does not know how to link to content outside of its current vhost. There is also no “default” vhost for sites currently, so only way to link between vhosts is via full URL. You can achieve this by concatenating correct vhost using a wrapper function on top of pageUrl for instance.