Content link with vhost map

Enonic version: 6.6.1
OS: Linux

Hi guys,

I’m have problem with link (href) in enonic. I’m adding a link to a content by using “Insert/edit link” button in HTML attribute and the link in frontend is broken. The href of link appears with text “_/error/400?message=URI+out+of+scope”.

I noted that the page that has link is mapped in virtual host. If I try to access the page with full URL, i.e, without vhost map, the link is shown correctly.

So, it seems there is a problem in enonic or thymeleaf when the link of href is rendered.

Do you have any suggestion?

Thanks!

I am having the same error.

I think this is simply due to linking outside of your site. As XP currently does not know the vhost to what you’re linking to it is unable to create this url and the result is what you see here.

I see… But the problem is with a “internal” link, i.e, when we try to create a link to another content in own enonic. For example, “full” URL of page is dyr/vilt/funn-av-syke-eller-dode-dyr and link “testadffasdfasdfasdf” is correct. Look imagem below.

And, the url configured in vhost file is:

mapping.vilt.host =
mapping.vilt.source = /vilt
mapping.vilt.target = /portal/master/aaaaa/dyr/vilt

We are trying to hide dyr from url. So, if I access the URL that is mapped in vhost file, vilt/funn-av-syke-eller-dode-dyr, the link “testadffasdfasdfasdf” is wrong and with text “_/error/400?message=URI+out+of+scope”. Look image below…

Are you deploying a single site using multiple different vhosts? This is not supported in any meaningful way, and easily explains why you get this problem. Why not simply remove “dyr” from the structure and things should work fine…

Hmmm. I see! Thank you so much! :slight_smile: