views:

58

answers:

1

I am in a standard paster-generated turbogears 2 project.
I am using:
allow_only = not_anonymous(msg=l_(u'You must be logged in'))
And I am using generated error.py controller. The issue is that I want to redirect the user to the front page('/') when the error controller identifies and 403 error.
Then I have tried tg.redirect(url('/')), but I am getting some sort of starndard 302 Found error, since redirect is nothing more than raise an webob.exc.HTTPForbidden exception.

A: 

302 is the HTTP status code indicating a Redirect request.

So if you want your 403 error to redirect, you will have to use a <meta> html tag in the file.

webdestroya
You mean, something like this? <meta http-equiv="Refresh" content="0; url=example.com/"; /> this will not work for me. It still be shown the default web server 302 page error.

related questions