Re: Absolute links to different webapps in same server as site root gets changed to relative links

Nacho Fernández via opencms-dev <[email protected]> Wed, 22 Jul 2026 12:41:00 +0200
Newsgroups gmane.comp.cms.opencms.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============0563166420091409741==
Content-Type: multipart/alternative;
 boundary="------------AEUkPzSMmIyRAm0hxS8KggKv"
Content-Language: es-ES

This is a multi-part message in MIME format.
--------------AEUkPzSMmIyRAm0hxS8KggKv
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi again. Thank you so much for the hint! Even not being the ideal way 
to tackle the issue (specially when the apps deployed vary a lot), it 
actually works nicelly. It is important to notice that the file 
/system/config/linkexcludes can be edited from the OpenCms workplace, 
but it requires changing the file opencms-importexport.xml, switching 
the <linksustitutionhandler> content from class 
org.opencms.staticexport.CmsDefaultLinkSubstitutionHandler to class 
org.opencms.staticexport.CmsAdvancedLinkSubstitutionHandler.

If someone else knows of a way of configuring this behaviour in a more 
general way it would be great to know about it.

El 21/07/2026 a las 13:44, Pavel Rath via opencms-dev escribió:
> Hello,
>
> we have OpenCms running as root webapp, but we also have another web applications on same server. To avoid marking links to other webapps as broken links, we have them listed in /system/config/linkexcludes (listed items as "/webapp1", "/webapp2" etc.). This might also help to your problem.
>
> Best regards,
> Pavel Rath
>
> -----Original Message-----
> From: opencms-dev<[email protected]> On Behalf Of Nacho Fernández via opencms-dev
> Sent: Tuesday, July 21, 2026 1:35 PM
> To:[email protected]
> Cc: Nacho Fernández<[email protected]>
> Subject: [opencms-dev] Absolute links to different webapps in same server as site root gets changed to relative links
>
> Hi all,
>
> Haven't found a solution looking up similar problems in the mailing list
> archive, so I'll try to shout out my problem:
>
> I have an OpenCms installation residing in a web server (let's call it
> https://myserver) with OpenCms itselft not as root webapp but deployed
> as /portal
>
> The urlhttps://myserver it set as "site root". Whenever I try to create
> an absolute link to a different webapp inside my server, which I need to
> do quite often, be it with the inline editor or directly editting the
> control code, OpenCms changes it automatically to a relative link
> pointing insidehttps://myserver/portal, ruining the link in the
> process. For instance, if my webapp is called "mywebapp" and I want an
> absolute linkhttps://myserver/mywebapp/whatever it gets changed inside
> the control code to a relative link to /sites/default/mywebapp/whatever
> which translates when I want to click it
> intohttps://myserver/portal/mywebapp/whatever
>
> Is there anyway to configure out this annoying behaviour? Can I just
> simply not list my actual server as the "site root", as I assume it is
> what OpenCms is using, without breaking anything important such as
> access to the workplace or static export? I already tried listing the
> site root as"http://myserver" (the not secure alternative) and it keeps
> behaving exactly the same.
>
> I would be REALLY grateful if I could get some hints from anyone. Thank
> you in advance,
>
> Nacho Fdez.
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> https://lists.opencms.org/mailman/listinfo/opencms-dev
>
>
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> https://lists.opencms.org/mailman/listinfo/opencms-dev
>
>
>
--------------AEUkPzSMmIyRAm0hxS8KggKv
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi again. Thank you so much for the hint! Even not being the
      ideal way to tackle the issue (specially when the apps deployed
      vary a lot), it actually works nicelly. It is important to notice
      that the file /system/config/linkexcludes can be edited from the
      OpenCms workplace, but it requires changing the file
      opencms-importexport.xml, switching the
      &lt;linksustitutionhandler&gt; content from class <span
style="color: rgb(36, 36, 36); font-family: &quot;Cascadia Mono&quot;, Consolas, ui-monospace, Menlo, Monaco, monospace; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">org.opencms.staticexport.CmsDefaultLinkSubstitutionHandler to class </span><span
style="color: rgb(36, 36, 36); font-family: &quot;Cascadia Mono&quot;, Consolas, ui-monospace, Menlo, Monaco, monospace; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">org.opencms.staticexport.CmsAdvancedLinkSubstitutionHandler.</span></p>
    <p><span
style="color: rgb(36, 36, 36); font-family: &quot;Cascadia Mono&quot;, Consolas, ui-monospace, Menlo, Monaco, monospace; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">If someone else knows of a way of configuring this behaviour in a more general way it would be great to know about it.</span></p>
    <div class="moz-cite-prefix">El 21/07/2026 a las 13:44, Pavel Rath
      via opencms-dev escribió:<br>
    </div>
    <blockquote type="cite"
      cite="mid:[email protected]">
      <pre wrap="" class="moz-quote-pre">Hello,

we have OpenCms running as root webapp, but we also have another web applications on same server. To avoid marking links to other webapps as broken links, we have them listed in /system/config/linkexcludes (listed items as "/webapp1", "/webapp2" etc.). This might also help to your problem.

Best regards,
Pavel Rath

-----Original Message-----
From: opencms-dev <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]">&lt;[email protected]&gt;</a> On Behalf Of Nacho Fernández via opencms-dev
Sent: Tuesday, July 21, 2026 1:35 PM
To: <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>
Cc: Nacho Fernández <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]">&lt;[email protected]&gt;</a>
Subject: [opencms-dev] Absolute links to different webapps in same server as site root gets changed to relative links

Hi all,

Haven't found a solution looking up similar problems in the mailing list 
archive, so I'll try to shout out my problem:

I have an OpenCms installation residing in a web server (let's call it 
<a class="moz-txt-link-freetext" href="https://myserver">https://myserver</a>) with OpenCms itselft not as root webapp but deployed 
as /portal

The url <a class="moz-txt-link-freetext" href="https://myserver">https://myserver</a> it set as "site root". Whenever I try to create 
an absolute link to a different webapp inside my server, which I need to 
do quite often, be it with the inline editor or directly editting the 
control code, OpenCms changes it automatically to a relative link 
pointing inside <a class="moz-txt-link-freetext" href="https://myserver/portal">https://myserver/portal</a>, ruining the link in the 
process. For instance, if my webapp is called "mywebapp" and I want an 
absolute link <a class="moz-txt-link-freetext" href="https://myserver/mywebapp/whatever">https://myserver/mywebapp/whatever</a> it gets changed inside 
the control code to a relative link to /sites/default/mywebapp/whatever 
which translates when I want to click it 
into <a class="moz-txt-link-freetext" href="https://myserver/portal/mywebapp/whatever">https://myserver/portal/mywebapp/whatever</a>

Is there anyway to configure out this annoying behaviour? Can I just 
simply not list my actual server as the "site root", as I assume it is 
what OpenCms is using, without breaking anything important such as 
access to the workplace or static export? I already tried listing the 
site root as <a class="moz-txt-link-rfc2396E" href="http://myserver">"http://myserver"</a> (the not secure alternative) and it keeps 
behaving exactly the same.

I would be REALLY grateful if I could get some hints from anyone. Thank 
you in advance,

Nacho Fdez.

_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<a class="moz-txt-link-freetext" href="https://lists.opencms.org/mailman/listinfo/opencms-dev">https://lists.opencms.org/mailman/listinfo/opencms-dev</a>



</pre>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre wrap="" class="moz-quote-pre">_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<a class="moz-txt-link-freetext" href="https://lists.opencms.org/mailman/listinfo/opencms-dev">https://lists.opencms.org/mailman/listinfo/opencms-dev</a>



</pre>
    </blockquote>
  </body>
</html>

--------------AEUkPzSMmIyRAm0hxS8KggKv--

--===============0563166420091409741==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KVGhpcyBtYWls
IGlzIHNlbnQgdG8geW91IGZyb20gdGhlIG9wZW5jbXMtZGV2IG1haWxpbmcgbGlzdApUbyBjaGFu
Z2UgeW91ciBsaXN0IG9wdGlvbnMsIG9yIHRvIHVuc3Vic2NyaWJlIGZyb20gdGhlIGxpc3QsIHBs
ZWFzZSB2aXNpdApodHRwczovL2xpc3RzLm9wZW5jbXMub3JnL21haWxtYW4vbGlzdGluZm8vb3Bl
bmNtcy1kZXYKCgoK

--===============0563166420091409741==--