You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to set up Shaarli under a subdirectory of my server (without the installation directory being a subdirectory of my server's root content directory).
Previously I used nginx and PHP 7.4, and Shaarli was able to auto-detect that it ran in a subdirectory, and used the proper path for routing and assets, so the site was usable.
Now I'm trying with Caddy and PHP 8.2. Shaarli does not automatically detect the subdirectory so I set general.root_url and general.header_link in Shaarli's config.json.php to the full address of the subdirectory : http://locness.local/grub/ (same results with and without escaping the slashes)
Visiting http://locness.local/grub/ or any URL under that shows a 404 page instead of the correct Shaarli page, probably meaning that the routing ignores the root_url. No CSS nor JS is loaded.
Looking at the page source it turns out those are linked from the webroot :
nodiscc
changed the title
root_url not taken into account for template assets and routing
root_url not taken into account for template assets and routing using Caddy
Nov 3, 2023
At first glance I'm not sure handle_path would be the correct directive here, since it strips the prefix. Have you tried with handle or other directives?
I'm trying to set up Shaarli under a subdirectory of my server (without the installation directory being a subdirectory of my server's root content directory).
Previously I used nginx and PHP 7.4, and Shaarli was able to auto-detect that it ran in a subdirectory, and used the proper path for routing and assets, so the site was usable.
Now I'm trying with Caddy and PHP 8.2. Shaarli does not automatically detect the subdirectory so I set
general.root_url
andgeneral.header_link
in Shaarli's config.json.php to the full address of the subdirectory :http://locness.local/grub/
(same results with and without escaping the slashes)Visiting
http://locness.local/grub/
or any URL under that shows a 404 page instead of the correct Shaarli page, probably meaning that the routing ignores the root_url. No CSS nor JS is loaded.Looking at the page source it turns out those are linked from the webroot :
There is only one instance of the root_url being used : the feeds
my Caddyfile
my truncated shaarli config.json.php
Let me know if you need any other config.
The text was updated successfully, but these errors were encountered: