Weird redirect happening with kirby on subfolder of site

I’ve installed Kirby at a subdirectory of a client’s existing site:

this initial page load works and all assets are correctly loaded. However, every consecutive request (clicking a link, or a fetch request) is inserting /en/ after the base URL resulting in a 404 on the main site, i.e

even manually entering (which should work because i have a multi lang install) auto redirects to

The main domain also auto redirects to on first load so I’m kind of assuming there is some server side language check happening in the background that leaks into Kirby.

I really don’t believe so, but is there any possible way whatsoever that this is caused by Kirby itself? Never ran it from a subdomain, so I wanna make completely sure before I go annoy the person who set up the server.

edit: tried via phone where my language is set to german, and it redirects to “de”. maybe there’s some measures I can take myself? maybe even make use of the fact that en and de already exist as languages on the base server, maybe i can read these preferences and apply to the kirby install somehow…

I assume the main domain treats the subfolder as part of the main domain, but what exactly is happening and why highly depends on the server setup.

I’ve run Kirby successfully in subfolders, but depending on the server configuration ( .htaccess), rewrite rules, routes, auto-language detection and what not, this might fail.

Things you can try is set the URL in config.

Is there a reason why you don’t just point a subdomain to the subfolder?

Done that!

Not from my point of view, but the person who manages the server wanted to use a subfolder instead… Will suggest again now.

Did you set the RewriteBase directive in your .htaccess in your mykirby subfolder to

RewriteBase /mykirby

and is it recognized at all?