URL Rewriting / RewriteRule for shared calendars

Hi all!

I am struggeling with the following issue with NC 28.0.3 on our shared hosting from “all-inkl”:

We are planning to share several public calendars in our community with a single link that includes all calendar tokens, like e.g. https://ourdomain.com/apps/calendar/p/token1-token2-token3-token4

Because the link will be shared in a variety of ways (email newsletters, apps, even on paper) I would like to avoid sharing this exact link and would like to use a dedicated shortened link instead. I was thinking of something like https://ourdomain.com/allcalendars or https://allcalendars.ourdomain.com

However, I would like to NOT use a regular redirect (with HTTP 301/302 or similar) because I am expecting that a lot of users will create a bookmark in their browsers. In this case, they would create the bookmark for the actual sharing link, not for the shortened link. Of course, there might be new calenders in the future while others could be removed. Because of that, I would like to prevent that anyone can “see” the actual sharing link - only the shortened URL should be visible which remains unchanged all the time, even if the sharing link changes.

To do so, I added the following line #5 to the .htaccess file in the nextcloud root (the [P] flag uses proxying instead of a redirect which doesn’t change the URL):

<IfModule mod_rewrite.c>
  Options -MultiViews
  RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]
  RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]
  RewriteRule ^allcalendars$ https://ourdomain.com/apps/calendar/p/token1-token2-token3... [P]
  RewriteCond %{REQUEST_FILENAME} !\.(css|js|mjs|svg|gif|png|html|ttf|woff2?|ico|jpg|jpeg|map|webm|mp4|mp3|ogg|wav|flac|wasm|tflite)$
  ...
</IfModule>

Now, when browsing to https://ourdomain.com/allcalendars, a Nexcloud “blank” page is displayed, which means that there is the background image, the header and footer line but no calendars.

I guess the problem might be that the actual sharing link again causes a url rewrite and that this type of “nested” rewrite doesn’t work.
Does anybody know how this could be solved? Is it possible to directly use the “final” calendar-link (which would result from rewriting the sharing link) in the .htaccess file? Or is there another problem with this .htaccess-approach?