In headless setups, Panel preview links point to the backend by default. Use the frontendUrl page method to redirect preview links to your frontend application.
Set the preview option in your blueprint to use the frontendUrl method:
options:
preview: "{{ page.frontendUrl }}"
For the site blueprint, use site.frontendUrl:
options:
preview: "{{ site.frontendUrl }}"
Configure your frontend URL in config.php:
return [
'headless' => [
'panel' => [
'frontendUrl' => 'https://example.com'
]
]
];
frontendUrl is empty, the preview button will be disabled.For headless-only projects, automatically redirect visitors to the Panel when they access your backend URL. This is useful when your Kirby installation serves no frontend content.
return [
'headless' => [
'panel' => [
'redirect' => true
]
]
];
When enabled, unauthenticated requests without a bearer token will redirect to the Panel login page.