<p>Try replacing <code>{id}</code> with <code>{slug}</code>. I guess it needs a slug, not an ID.</p>

CC BY-SA 3.0
2016-07-29T14:18:00.347Z
You're right - and the docs probably wrong. Thank you very much!
MISC
CC BY-SA 3.0
2016-07-29T14:20:50.963Z
Glad I could help :)
Gustavs
CC BY-SA 3.0
2016-07-29T14:13:03.883Z
2016-07-29T14:13:03.883Z
Gustavs
<p>I use a front-end entry form based on the official documentation (<a href="https://craftcms.com/docs/templating/entry-form" rel="nofollow">https://craftcms.com/docs/templating/entry-form</a>), but after saving the entry, I am running in an error 404 on the entry page.</p>

<pre><code>&lt;input type="hidden" name="redirect" value="viewentry/{id}"&gt;
</code></pre>

<p>But if I replace the entry id with the slug in the browser (example.com/viewentry/example), then it works.</p>

<form><redirect><saveentry>
Entry Form: redirect not working
# Entry Form: redirect not working

(Asked by: username_0 on 2016-07-29)

I use a front-end entry form based on the official documentation (https://craftcms.com/docs/templating/entry-form), but after saving the entry, I am running in an error 404 on the entry page.


But if I replace the entry id with the slug in the browser (example.com/viewentry/example), then it works.

**Tags:** form, redirect, saveentry


---

## 1 answers

### Answer by username_1 on 2016-07-29. Score: 1 | Accepted answer

Try replacing `{id}` with `{slug}`. I guess it needs a slug, not an ID.

> **Comments:**
> **username_0**: You're right - and the docs probably wrong. Thank you very much!  
> **username_1**: Glad I could help :)  

---

