Different home / index to kirby folder

I would like to load kirby so that the home page and kirby core files are in different locations. Here’s my set-up.

Folder structure:

| kirby
| content
| site
| rest of kirby plainkit etc.
| index.php

inside the index.php in ‘products’ I have:


include __DIR__ . '/../api/kirby/vendor/autoload.php';

$kirby = new Kirby([
 'roots' => [
   'index'    => __DIR__,
   'base'     => $base    = dirname(__DIR__) . '/api',
   'content'  => $base . '/content',
   'site'     => $base . '/site',
   'storage'  => $storage = $base . '/storage',
   'accounts' => $storage . '/accounts',
   'cache'    => $storage . '/cache',
   'sessions' => $storage . '/sessions',

echo $kirby->render();

which works to display the homepage at www.domain.com/products but subpages error with a blank page www.domain.com/products/product-1 for example does not display.

How do I make the full site available at www.domain.com/products whilst keeping kirby at www.domain.com/api - is this possible?

Thanks for looking!

What about the .htaccess file?

Slaps forehead! … that was of course it. I didn’t move it and I didn’t RewriteBase to products.

RewriteBase /products

Working as should thank you!