Subfolder with different domain names

We have multiple domains. For instance.

dev.mysite.com
staging.mysite.com
master.mysite.com

So what I need to do is make Kirby work in a subfolder.

For instance http://dev.mysite.com/resources

The subfolder would be “resouces”.

The issue I’m having is a lot of the documentation that mentions how to make Kirby work from a subdirectory is also followed by a static domain.

Something like this: c::set(‘url’, ‘http://www.mydomain.com’);

followed by a rewrite rule

RewriteBase /mydomain

// Any suggestions on how to make this work with these multiple changing domains.

Have you checked if you need to set the URL and the RewriteBase in your environment? Kirby usually discovers if it runs in a subfolder and there is no need to set the URL in your config.php.

Apart from that, you can have different config files for each environment/domain.

In many cases, it is also not necessary to set a rewrite base. But isn’t the subfolder the same for each domain in your case, so setting your RewriteBase to

RewriteBase /resources

should be sufficient?

The RewriteBase is the name of the subfolder, not of the domain.