[opencms-dev] Exclude directory from VFS
Michael Emmerich
emmerich at german-navy.de
Thu Nov 25 09:52:18 CET 2021
Hello Kai,
yes this is possible.
1) In the opencms-importexport.xml config file, replace the line
<linksubstitutionhandler>org.opencms.staticexport.CmsDefaultLinkSubstitutionHandler</linksubstitutionhandler>
with
<linksubstitutionhandler>org.opencms.staticexport.CmsAdvancedLinkSubstitutionHandler</linksubstitutionhandler>
2) In your OpenCms, there is a file /system/config/linkexcludes/
in it, you can define those paths that are no identified as non-OpenCms,
e.g. external to the application.
Example: Your OpenCms runs as the ROOT-Webappliciiton at
https://www.myserver.com
Therefore everything starting with "https://www.myserver.com" will be
seen as an internal Link in OpenCms. When you now do the configuration
as above ans add "/myexternalapp" to the /system/config/linkexcludes/
config file,
https://www.myserver.com/myexternalapp will not be seens as an internal
OpenCms link.
Hope this helps,
Michael
Am 25.11.21 um 09:46 schrieb Kai Widmann:
> Hello there,
>
> one of our customers has – for whatever reason – decided to add a blog
> to an OpenCms site that’s not run by OpenCms but by Typo3 running on a
> different machine/port. Using the fronting Webserver (Apache or Nginx)
> they then mapped the blog to a subdirectory of the OpenCms server –
> again for whatever reason. So the situation is now:
>
> * OpenCms runs on https://www.sample.net/
> * The Blog, powered by Typo 3, runs on https://www.sample.net/blog
>
>
> No, they didn’t ask me in advance, if that might cause trouble ;)
> Now the problem ist, that links from OpenCms pages to Blog articles
> are not possible with the usual OpenCmsVarLink fields. If you try to
> add an „external“ link to something below /blog, OpenCms thinks that
> there should be a VFS resource at this location in the VFS, but since
> there is not, an error is displayed in the editor's form.
> Which leads to my question: is there any way to configure OpenCms to
> treat everything below /blog as external and not part of the VFS? Can
> specific folders be excluded from the VFS so that it’s possible to
> link to virtual resources outside of OpenCms.
>
> If that’s possible, that’s the way I’d like to go, but if not I’ll use
> a workaround and tell the editors to use a different domain for the
> blog, so that links are treated like usual external links. Using a
> custom LinkSubstitutionHandler I’d revert the domain back to the
> normal domain when outputting the pages for the frontend. But that
> wouldn’t be my preferred solution, because editors would not be able
> to just copy the blog URL from their browser and I’m quite sure that
> it wouldn’t take long for the first editor to forget all about
> swapping the blog domain.
>
> Any help is highly appreciated!
>
> Kai
>
> _______________________________________________
>
> Kai Widmann
> mediaworx berlin AG
>
> +49 30 27580-262
> Digitale Visitenkarte: https://mediaworx.com/021
> www.mediaworx.com <http://www.mediaworx.com>
>
>
> _______________________________________________
> 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
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20211125/2ae7bb8c/attachment.htm>
More information about the opencms-dev
mailing list