Forum
404 problem
I am having trouble getting Runway to show my styled 404 page consistently
See these urls: https://vehicleleasemanagement.co.uk/kokopkpk/ or https://vehicleleasemanagement.co.uk/kokopkpk
Both return just the header and footer
However if I change the url to https://vehicleleasemanagement.co.uk/kokopkpk: (note the colon at the end) or https://vehicleleasemanagement.co.uk/kokopkpk.php
the 404 page shows as I would like.
This is how the Page Options look in Perch https://www.evernote.com/l/Ai8LKYE-Vl5NwYWqcAC1ywG6pbZEB8bAQ0s
How can I correct this?
Do you have anything other than the recommended rewrite rules in your server config?
This is in the .htaccess
What's the difference between those pages?
I've put debug on:
This url seems to match a route https://vehicleleasemanagement.co.uk/iooioiooi
This url doesn't https://vehicleleasemanagement.co.uk/iooioiooi.php and the 404 loads fine
It looks like it hits the last route in the order and then loads that page template which in this case is
There's your answer then. You'll need to handle the missing deal scenario in your page.
In Runway 3 you'll be able to do this...
How could this be done?
That's a question to put to your developer rather than me.
I am the 'developer' on this project. It's the reason Perch is used i.e it's ease of use for Frontend designers to work with :)
I'll see what I can figure out.
Neil, sorry I had to laugh with this response.... lol
When you add the colon to the end of the URL it no longer matches your defined route therefore the 404 error. With a file extension it's seen as a file and with no matching file in the directory you'll get the 404.
I'm having a hard time understanding how the links would be formed wrong if you are creating the links. I'm a visitor is making the error then the 404 is the best result, as only proper links should be honored by the server.
Please explain what your trying to prevent or allow so we can help find a working solution.
Hi Robert,
:)
Basically I am just trying to catch malformed urls which may exist in links from other websites or links from other sites to pages that no longer exist and instead show the visitor a styled 404 page with reason why page wasn't found and what to do next.
On standard Perch sites e.g. not Runway, I build a 404.php then put the following in the .htaccess file
It's how I've always done it but it doesn't work with Runway
I'm thinking that has to be the first line in your htaccess before the perch specific stuff. The only problem this will likely bypass any perch error handling as far as 404's.