404 Solara Router
Hi, when you try and go to a Solara page which doesn’t exist you will see a very simple page which has the text "Page not found by Solara router". Is there a way of either replacing this with a different page, eg my own 404 page not found, or redirecting the user from the default Solara "Page not found by Solara router" page to one I define, eg my own 404 page not found?
6 Replies
Hey @Harry!
Currently it's not possible to customize the 404 page, or to redirect to a different page. This would be a good feature to have, so I'll take another look at implementing this next week, unless you would like to work on it and open a PR. Let me know if you do and maybe I can give you some pointers
Hi @cr33pyguy,
thannk you for getting back. Unfortunately, I don't have time to work on this at the moment, but it would be an awesome and very useful feature for Solara!
No worries! I'll try and take a look at it later this week.
awesome thank you @cr33pyguy
@Harry please take a look at https://github.com/widgetti/solara/pull/670
maartenbreddels
<:pull_open:882464248721182842> [widgetti/solara] fix: if we hit a 404 in starlette, raise instead of render a 404
This allows middleware or error handlers to catch the 404 and do something custom.
Example:
Created