# Custom Error Pages

**URL:** <https://community.weweb.io/t/custom-error-pages/7621>\
**Category:** How do I?\
**Created:** [March 18, 2024, 2:39pm UTC](https://community.weweb.io/t/custom-error-pages/7621 "2024-03-18T14:39:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![archenia\_jsanchez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/archenia_jsanchez/32/8656_2.png) [@archenia\_jsanchez](https://community.weweb.io/u/archenia_jsanchez)\
**Post date:** [March 18, 2024, 2:39pm UTC](https://community.weweb.io/t/custom-error-pages/7621/1 "2024-03-18T14:39:48Z")

</div>

I’m at the point in my project where I want to create custom error pages, eg 404 and 500.

1. Is there a best practice for this, particularly the 404? I imagine there would be something in the workflow to redirect to my custom 404 page.
2. As for the 500, there could be unplanned down time, which I can’t figure out how WeWeb would know this, and then there could be planned down time which might be as simple as passing a variable to the system to redirect to the respective “down for maintenance” page.

What advice do you have for approaching these 2 scenarios?

---

<div class="post-metadata">

**Author:** ![IKR](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/ikr/32/8200_2.png) [@IKR](https://community.weweb.io/u/IKR)\
**Post date:** [March 18, 2024, 7:07pm UTC](https://community.weweb.io/t/custom-error-pages/7621/2 "2024-03-18T19:07:14Z")

</div>

500 not sure, but 404 you can just name the path of your page.

In any way if you use WeWeb as “hosting” i don’t know.

But usually you will have a response from your source, whatever it is. And i am sure they will give an error code. That one you can bind to the path of your page.

Do you have self-hosting?

---

<div class="post-metadata">

**Author:** ![archenia\_jsanchez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/archenia_jsanchez/32/8656_2.png) [@archenia\_jsanchez](https://community.weweb.io/u/archenia_jsanchez)\
**Post date:** [March 18, 2024, 8:48pm UTC](https://community.weweb.io/t/custom-error-pages/7621/3 "2024-03-18T20:48:03Z")

</div>

It looks like we are using WeWeb for hosting—the Self-Hosting tab still shows an add to upgrade to self-hosting.

So if I understand you correctly, you’re suggesting that as long as I have a /404 page in the app, a 404 will automatically redirect to this page? Is that right?

In contrast, I was sort of expecting WeWeb to trigger an error that I would read, for example on appLoad workflow, and redirect to said page, but things are much easier if its automatic.

---

<div class="post-metadata">

**Author:** ![IKR](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/ikr/32/8200_2.png) [@IKR](https://community.weweb.io/u/IKR)\
**Post date:** [March 18, 2024, 9:18pm UTC](https://community.weweb.io/t/custom-error-pages/7621/4 "2024-03-18T21:18:03Z")

</div>

Ehm, not 100% but almost.

For the 404, see here:

> **[Create 404 page | WeWeb documentation](https://docs.weweb.io/pages/404-page.html)**
>
> Learn how to create a 404 page in WeWeb

For 500, you need a server response, that one i dont know as well yet, but in that case you can export the code and host without using the weweb hosting, since they dont have a proper hosting in my opinion. which you are most likely doing at the moment. the only way with the self hosting i see, is that you need to avoid the weweb dependencies like stripe etc. there was somewhere in the forum about that, just can not look for it atm

---

<div class="post-metadata">

**Author:** ![archenia\_jsanchez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/archenia_jsanchez/32/8656_2.png) [@archenia\_jsanchez](https://community.weweb.io/u/archenia_jsanchez)\
**Post date:** [March 18, 2024, 9:31pm UTC](https://community.weweb.io/t/custom-error-pages/7621/5 "2024-03-18T21:31:49Z")

</div>

🤦‍♂️ I’ve gotten so used to searching the Community for help, I forgot there was official documentation. That was helpful. Thanks!

---

<div class="post-metadata">

**Author:** ![what.gift](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/what.gift/32/8069_2.png) [@what.gift](https://community.weweb.io/u/what.gift)\
**Post date:** [March 19, 2024, 4:22pm UTC](https://community.weweb.io/t/custom-error-pages/7621/6 "2024-03-19T16:22:28Z")

</div>

Well… the official docs are pretty weak and the old docs appear in google, which then gets extra confusing! I’m learning all sorts from the official YouTube channel which at least is quite active and nice to see.

I’ve noticed the forum is getting more lively from last year which is good see though 🙂

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [March 19, 2024, 9:04pm UTC](https://community.weweb.io/t/custom-error-pages/7621/7 "2024-03-19T21:04:26Z")

</div>

Thanks for pointing that out @what.gift, appreciate it!

We’re taking steps to fix this. In the meantime, the old docs that appear in search results should be redirecting to the new ones.

Can you tell me more about why you feel the official docs are weak so we can work on improving those as well?

---

<div class="post-metadata">

**Author:** ![archenia\_jsanchez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/archenia_jsanchez/32/8656_2.png) [@archenia\_jsanchez](https://community.weweb.io/u/archenia_jsanchez)\
**Post date:** [March 20, 2024, 4:49pm UTC](https://community.weweb.io/t/custom-error-pages/7621/8 "2024-03-20T16:49:50Z")

</div>

@Joyce, do you happen to know how 500s would be handled? For example, in the scenario where we are doing nightly scheduled maintenance and want to prevent someone from logging in during this time; would WeWeb automatically know that we are doing maintenance and redirect the visitor to a custom 500, or would we need to pass a variable into WeWeb and use that to redirect the visitor?

---

<div class="post-metadata">

**Author:** ![IKR](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/ikr/32/8200_2.png) [@IKR](https://community.weweb.io/u/IKR)\
**Post date:** [March 21, 2024, 4:04am UTC](https://community.weweb.io/t/custom-error-pages/7621/9 "2024-03-21T04:04:24Z")

</div>

Boolean variable for Maintenance Mode.  
Global workflow to handle the logic for showing the maintenance page that you can just create.

that’s how i made it
