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:19
On 6/29/06, Kristoffer <soderqvistgmail.com> wrote:
> I was a bit unclear, but I want to redirect the user to
a completely
> new location in case of an error.
>
> Say, for example, that the user navigates to
> http://mysite.org/my
app/dir/page, which causes an internal error. I
> would like the user to get redirected to
> http://someothersit
e.org/500.html instead of a 500-page that is under
> control of django.
>
> Would that be possible?

Yes. For that, you'd do exactly what I wrote in the
previous e-mail.
Use a custom handler404 and handler500.

http://www.djangoproject.com/
documentation/tutorial3/#write-a-500-server-error-view

As I wrote in the previous e-mail, I would strongly suggest
you don't
do this, for usability.

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 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 )