#1 May 6, 2025 2:52pm

doon.mok
Member
Registered: May 6, 2015
Posts: 148

Different 404 for routed template

Is it possible to have a different 404 for a routed template?
Examples:
localhost/routed/issue/
I have issue.php and if it doesn't come back with any information, I have a _404.php that is different from the overall website.

localhost/routed/issueeee/
This will go to the default 404. Is there a way to go to my custom _404.php?

Thanks

Offline

#2 May 6, 2025 3:12pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 982

Re: Different 404 for routed template

You could handle it two ways. The first way is just not call BigTreeCMS::handle404 in your issue.php file when you encounter a 404 and instead include your custom 404 page and manually throw a 404 header. You won’t get BigTree’s included logging and redirect behavior with that though. The alternative is to extend the BigTreeCMS class and the handle404 method and have it accept a parameter for a custom path for the 404 file to draw.

Offline

#3 May 7, 2025 10:43am

doon.mok
Member
Registered: May 6, 2015
Posts: 148

Re: Different 404 for routed template

Thanks, Tim!

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.