List Info

Thread: Redirect to another location in case of 404 and 500




Redirect to another location in case of 404 and 500
user name
2006-06-29 12:23:57

Adrian Holovaty wrote:
> You can define custom handler404 and handler500
functions in your
> URLconf. Just set it like this:
>
>     handler404 = 'path.to.view'
>     handler500 = 'path.to.other.view'
>

This seems to be what I am looking for.

> But I would STRONGLY suggest that you DO NOT redirect
404s to a
> generic 404 page. That is a horrid practice. If I
mistype a URL, let
> me see what I mistyped in my browser's location bar;
don't redirect me
> to some strange URL.
>
> If you do this on your Web site, we may revoke your
Django privileges.
>

Thank you for your piece of advice, I don't consider
redirecting any
more.
I will still need to take some specific actions, though, so
I'll give
custom 404 and 500 handlers a try.

Thanks,
Kristoffer


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )