hi!
i know this is a bit of a classic question when deploying kirby on a shared-hosting server, and generally i always managed and learned how to fix this problem (eg with RewriteBase
in .htaccess
). this time it seems more complicated than usual and the hosting environment is not a shared web-hosting, but a custom university server behind a VPN where i can’t communicate with the ITC.
i have the current problem:
accessing the website gives me back only the HTML response of the given route. all assets as well as any link generated by kirby via ->url()
has the wrong URL. eg:
- instead of being
website.com/section/my-website
- it is
website.com/my-website
at first i tried to set RewriteBase /section/my-website
and what it does is to produce a 404 for any subpage i visited of the website. if i remove the RewriteBase
rule and access any of the subpage at the correct URL, i get back the HTML response (minus the assets).
then i tried to manually set the SERVER_NAME
(ref) and it fixed the assets loading but every visited page with the correct URL would return 404. i tried to combine both setting the url
in site/config.php
with the RewriteBase
and no improvement either.
for completeness:
- using
php_info()
showed me that theSERVER_NAME
iswebsite.com
- the provided
.htaccess
from the ITC starts with a rule like this:
<FilesMatch \.php$>
SetHandler "proxy:fcgi://127.0.0.1:<port>"
</FilesMatch>
since the root of the problem is how Kirby internally generates URL to resources, is there something else i can try? did i combine or used each of the two above mentioned techniques wrongly?