Forum

Thread tagged as: Runway

Multiple 404 pages in Runway 3

I recall something about different 404 pages now being available for different parts of a website (with Runway 3) but I can’t find it again. It doesn’t seem to be in the docs yet (using search). Does anyone recall reading it, or can point me to it?

Graham Street

Graham Street 17 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I do't recall anything about that. What are you trying to achieve?

For example ... for most pages on the website, we're happy to have a standard 404 error page and have this set up and working already. However, we will have pages inside /news and /members on the site and these will come and go. The 'folders' of /news and /members are not real on the server, but in the Runway site structure. When pages in one of those 'folders' is removed, we'd like to send visitors to different 404 pages.

Duncan Revell

Duncan Revell 78 points
Registered Developer

Are you thinking of the ability to route to an error page?

PerchSystem::use_error_page(404);

Possibly. Could you explain with an example?

Duncan Revell

Duncan Revell 78 points
Registered Developer

I'll confess to not having massively road tested it, but I think the theory is that in your page you can

if (something) {
do some super page stuff
} else {
PerchSystem::use_error_page(404);
}

It's a way to redirect the Runway routing engine (that wasn't available in 2). The file name in the brackets has to exist in the errors page folder. Which in theory lets you specifiy other error pages - but it's this I haven't tested - and I think you're limited to one 404, one 405, one 406 etc (if you see what I mean). The page has to equal a status code.

So it's not quite what you're after, but may have been what you were thinking of.

Thanks - I'll have a play around with that idea in a 'dev' copy of the site and then report back.