Open JerikoOne opened 11 months ago
Thanks for your issue report.
As I wrote on Discord, the fact that the subfolder is missing in the URL is intended. The writer field inserts permalinks like /@/page/UUID
(without the domain) to be compatible with setups on different hosts (e.g. multi-domain multi-language or local development hosts). So it also doesn't include the subfolder. But if your site uses the <base href="<?= url() ?>">
element in the HTML <head>
, the browser will route those links to the proper locations.
Infinite redirects are however indeed Kirby's responsibility and are considered a bug. I haven't tested it myself yet though.
Description
When Kirby is installed in a subfolder https://domain.tld/subfolder, page links added through the writer field/text block are not added correctly, the subfolder is cut off from the link, e.g. https://domain.tld/@/page/UUID. If for testing purposes you manually add the subfolder to the created link e.g. https://domain.tld/subfolder/@/page/UUID and open it, the resolved link becomes https://domain.tld/subfolder/subfolder/and/so/on, so it seems the resolve method doesn't recognize the subfolder as base.
Expected behavior
The created link should include the subfolder in which Kirby is installed, e.g. https://domain.tld/subfolder/@/page/UUID. The resolved link should point to https://domain.tld/subfolder/and/so/on
To reproduce
Your setup
Tested with Kirby RC2 and RC4
Additional context
Field method
->permalinksToUrls()
works as expected, also when Kirby is installed in a subfolder.