# Como fazer um redirecionamento de páginas inexistentes

**URL:** https://meta.discourse.org/t/how-to-make-a-redirect-from-non-existent-pages/402807
**Category:** Self-hosting
**Created:** [12 Maio , 2026 18:30 UTC](https://meta.discourse.org/t/how-to-make-a-redirect-from-non-existent-pages/402807 "2026-05-12T18:30:30Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [12 Maio , 2026 18:58 UTC](https://meta.discourse.org/t/how-to-make-a-redirect-from-non-existent-pages/402807/2 "2026-05-12T18:58:12Z")

</div>

Tente isto:

> [@How to Redirect all 404 pages to home?](https://meta.discourse.org/t/how-to-redirect-all-404-pages-to-home/235187/15?u=merefield):
>
> You can handle all broken 404 pages to the home page or another page using the “Customize” feature. Go to the section Customize \> Themes \> Create New Theme \> name your theme ex 404 Redirect and set the Base Theme to Default. Then create the new theme \> Edit CSS/HTML. In the HTML section, create a JavaScript snippet that will handle the redirection. Past this code. \<script type="text/discourse-plugin"\> api.onPageChange((url, title) =\> { // Redirect to the home page for all 404 pages …

---

_[View the full topic](https://meta.discourse.org/t/how-to-make-a-redirect-from-non-existent-pages/402807)._
