Hide all the pages with a tobool in the entire website option flagged

Hi everyone,
I have a rather strange request: I have two identical sites, that sync every day the content folder, and I would like to show only the pages that have a toggle selected on the first aaa.mywebsite.com. In the other (bbb.mywebsite.com) instead all.
This is for the whole site, so I guess I need to use routes?
Can you help me? Thank you

Well, yes, you can use a catch-all (:all) route, then redirect to the error page when the toggle is not set.

But that alone won’t help to not render pages in a list of pages or the navigation. For that you would have to filter pages by that toggle.

On a side note, you should take care of duplicate content using canonical link elements

I have not replied, but for completeness I wanted to tell you that I solved it without using the routes.

I set up a cronjob on the server to update all folders from site aaa.mywebsite.com to site bbb.mywebsite.com except the “collections” folder.

In the files of the collections folder, all pages are filtered according to the set toggle.

I hope I made myself clear.