Content Representations return 404

I dont know why, but any content representation redirects to error page 404.

The site is an update from an K2 site who the content representation of .json work before.

Any idea for my issue ?

Could you provide some more context and some example code that is not working, please? Are you in a single or multi-language Kirby installation?

I have multi language activated, but only on language.


campaigns.json.php :

<?php
echo json_encode($response);

Same with this test :


What does your language configuration look like? Are languages enabled in the config?

config.php :
‘languages’ => true,

language folder in site folder :
fr.php

return [
  'code' => 'fr',
  'default' => true,
  'direction' => 'ltr',
  // 'locale' => [
	// 	LC_COLLATE  => 'fr_FR.utf8',
	// 	LC_MONETARY => 'fr_FR.utf8',
	// 	LC_NUMERIC  => 'fr_FR.utf8',
	// 	LC_TIME     => 'fr_FR.utf8',
	// 	LC_MESSAGES => 'fr_FR.utf8',
	// 	LC_CTYPE    => 'fr_FR.utf8',
	// ],
  'locale' => 'fr_FR',
  'name' => 'Français',
  'url' => '/',
  'translations' => […]
];

It looks as if the content representation doesn’t play with the / URL. I can reproduce the issue and it seems to work when using /fr instead of /.

Thanks, it is working with “/fr”.
How to do now to make it work with the default version ‘/’ ?

I created an issue on GitHub:

I’m not aware of a workaround at the moment

I tried the new version 3.0.3Rc1 with the patch, but instead of having a 404 redirect as before, I am redirected to the main content and not to the Json version of my content.

Yep, I experience the same effect.