Custom route includes the homepage view

If we configure the Homepage Settings (Appearance > Customize > Homepage Settings), this content will be added at the end of any Routes (ex.: /welcome/).

Any idea why it is appearing there?

It seems to me that the action template_redirect is not called properly in public/wp/wp-includes/template-loader.php.

I’m not able to reproduce this :thinking:

Can you try running wp acorn optimize:clear?

Are you able to reproduce this issue using either Lando or Trellis from the Radicle-included configs/setup?

Yes I already tried the command.

Sorry I don’t have Lando or Trellis installed.
I usually use the PHP built-in server.
Never had any problem with any WordPress site or even Sage v9.

It’s the first time using the Acorn Routing.

I see you have same issue as me.

See my topic for current solution I found:

Thank you @sijobo !

It solves the problem by adding exit; at line #237 of the Bootloader.php file:

There is no bug when using a webserver like Apache or Nginx.

Only when using the PHP built-in server:
https://www.php.net/manual/en/features.commandline.webserver.php

@ben to reproduce the bug:

Install Radicle:

composer install
cp .env.example .env
yarn && yarn build

Run the PHP built-in server:
cd public && php -S localhost:8000
or
wp server --host=localhost --port=8000

Go to http://localhost:8000/welcome/

It will show:

:wave: Welcome to Radicle

and the default content of the homepage.

I’m on PHP 8.1.

2 Likes