[Twisted-web] redirecting root resource

Maarten ter Huurne maarten at treewalker.org
Sun Feb 24 09:20:57 EST 2008

On Sunday 24 February 2008, Federico Tomassini wrote:

> how can I redirect systematically the root url "/" ?

(assuming you're using twisted.web, not web2 or nevow)

On the root resource, add a child resource with the empty string as its 
name. That child resource will only be rendered for "/", not for anything 
deeper in the hierarchy. In the child resource's render() method, issue a 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20080224/38d8d3d9/attachment.pgp

More information about the Twisted-web mailing list