Routing setting for 404

Hello,

I can’t do “routing setting” for 404 error correctly.

Currently, I can see 404.php with reading css correctly.
(https://bestinx.me/404.php)
And .htaccess file setting is also OK.
But the routing setting seems something wrong.
Other pages’ routing settings look fine.

By the way, I’ve set route properties like below.
Path: /404
Url: 404.php
Exact: True

Please let me know how to fix it.

Just to clarify here (this is hosted on wapplerhosting.com and we have been discussing this via that)

Adding

ErrorDocument 404 /404.php

to the .htaccess file correctly redirects any 404 error to the 404.php page althought he appears to have that page set to white text on a light grey background so it is difficult to see.
(In have re-added that Miwa)
Try a non existent link like this to see this:
https://bestinx.me/asdasdasd

Miwa wants to add this throught Wappler routing rather than via editing the .htaccess file

Can that same functionality be added via a wappler routing setting?
Anyone know how?

Hi Brian,

I had a similar question a month ago but didn’t get a response:

Yes, manually editing the .htaccess file is pretty much industry standard but via routing is not clear

2 Likes

Guys, just add these in your htaccess files.
The routing in Wappler is for the pages your users browse only, so you can create some more seo friendly urls.

3 Likes

Thanks teodor, i thought that would be the case
So @Miwa you will have to stick with the manual edit procedure I outlined (which I have re-added for you) .
You just need to edit the CSS as white on grey cant be read easily!

1 Like

Thanks for the info. That’s no problem. Nevertheless it would be a great addition in the Routing Panel.

Thank you guys!

Now I get it!!

I’ll try to remove routing from 404.php.

Now I can see what I wanted!!

https://bestinx.me/asdfasdf

thanks a lot!!

1 Like

is there still no way to set up a 404 error page in the routing (PHP project)? I thought there was but I can’t seem to find and info on the forums.

Not sure if it is the same for PHP but in Node the route for a 404 is a wildcard (ie, if no page matches any route prior then show the defined page for the wildcard).

*

It needs to be the final route in the routing table (VERY IMPORTANT it is the final entry otherwise any route afterwards will be ignored). This can point to any page you want. In our case it is as follows @brad

404 is a page that exists (it can be any page), its not just an entry of 404 (its the actual page name in this circumstance). For all intensive purposes it could be the index page, or any other page you have defined/created, but it must exist.

1 Like

I think that is just a node thing. I tried that with PHP and it didn’t work. Ended up doing it directly in the .htaccess file.