[opencms-dev] Creating internal links in ADE does not work as expected, always puts server name in link

Jan Michael Greiner jan0michael at yahoo.com
Sun Jan 2 09:05:21 CET 2022


Dear all,


I found out, if I edit the controlcode, and change the link (from the mentioned example) from

<target><![CDATA[/sites/default/technologien/]]></target>

 to

<target><![CDATA[/technologien/]]></target>

the file is saved with

<target><![CDATA[/sites/domain1/technologien/]]></target>

(The edit control code function does some content changing in the background, when saving.)



The domain1 makes browsing the website with https://domain1.de and https://www.domain1.de work as expected.
So it still is not a relative link, but works like it should.
So making the workplace accessible through https://domain1.de would be an option.
How can I achieve that?
I tried to copy /sites/default/login/index.html to /sites/domain1, but that just gives an empty template page, and there still is no login function.


Best regards,

Jan Michael Greiner


---------

 On Sunday, January 2, 2022, 08:43:25 AM GMT+1, Jan Michael Greiner <jan0michael at yahoo.com> wrote: 

Dear all,


In my OpenCms 12 installation I have the following Domains (names changed) configured on my reverse proxy:

cms.domain1.de, forwarded to real server https://opencms-workplace:8443

www.domain1.de, forwarded to real server https://opencms-domain1:8443

domain1.de, forwarded to real server https://opencms-domain1:8443

www.domain2.de, forwarded to real server https://opencms-domain2:8443

domain2.de, forwarded to real server https://opencms-domain2:8443

www.domain2.com, forwarded to real server https://opencms-domain2:8443

domain2.com, forwarded to real server https://opencms-domain2:8443


On the internal/real opencms server I have configured in the site management (Launchpad - Websites):

/sites/default
Server URL: https://cms.domain1.de, Alias: https://opencms-workplace:8443

/sites/domain1
Server URL: https://domain1.de, Aliases: https://opencms-domain1:8443, https://www.domain1.de

/sites/domain2
Server URL: https://domain2.de, Aliases: https://opencms-domain2:8443, https://www.domain2.de, https://domain2.com, https://www.domain2.com


Problem:
I access the Workplace (and advanced direct edit - ADE) through https://cms.domain1.de.
If I try to create an internal link in ADE for the domain1 website, there is always an absolute link created, including the server name. When I create the link, everything looks fine - like if a relative link is created - see attached screenshot create_link.png.

But then, if I look with "Edit controlcode" in the created content file, there is
<target><![CDATA[/sites/default/technologien/]]></target>
And when I browse the website, the link is always shown as
https://cms.domain1.de/opencms/technologien
instead as it should, as relative link, with just "technologien" (or changed by the <cms:link> internal mechanism as "/opencms/technologien").

Of cource cms.domain1.de does not serve the website of domain1 (unless for users that are logged in in the Workplace, and have selected /sites/domain1 as their current site, I think - what is not the case for external website visitors).


As a workaround, I can edit the controlcode of the content file and change /sites/default/technologien/ to just /technologien/.
But that is not how I expect OpenCms to work :-)

What am I doing wrong?


I was thinking about adding the login function for the Workplace to domain1. But then the links would probably be https://domain1.de. And I do not want users browsing https://www.domain1.de to be switched to https://domain1.de, by clicking a website internal link. So I think that would not be a perfect solution.
I just want relative links, not absolute links.

Could the problem be related to this question:

https://webmail.opencms.org/pipermail/opencms-dev/2019q4/042537.html

?


Best regards, and a happy new year!

Jan Michael Greiner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: create_link.png
Type: image/png
Size: 12920 bytes
Desc: not available
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20220102/272d7273/attachment.png>


More information about the opencms-dev mailing list