On 6/29/06, Kristoffer <[EMAIL PROTECTED]> wrote:
> Is there a simple way of redirecting the user to another location in
> case of a 404 or a 500 error, like /mysite/global404.html and
> /mysite/global500.html, respectively, instead of showing the standard
> 404 and 500 templates?
Hi Kristoffer,
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'
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.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---