InternalRedirect does double duty
!InternalRedirect switches from one handler to another. For some time now (at least since ) !InternalRedirect has been schizophrenic, being asked to handle two very different needs:
- Those cases that require path_info to be rewritten. !CherryPy 3 has no use cases for this; all have come entirely from user applications.
- Those cases that requre path_info to ''not'' be rewritten. This includes the virtual host tool and the XML-RPC tool. These should not rewrite path_info because that then affects systems like cherrypy.url, which expect the original path_info. See  for an example of a test that fails when virtual_host is implemented using !InternalRedirect.
My recommendation is that these two needs be met with separate features. The attached patch changes virtual host and xmlrpc, implementing them via dispatch wrapper functions instead of hooks + !InternalRedirect. This leaves !InternalRedirect free to meet only those cases which require path_info to be rewritten. There has been some discussion lately of dropping !InternalRedirect, or possibly reimplementing it to use multiple Request objects in order to avoid some of the hook reentry madness described [http://groups.google.com/group/cherrypy-devel/msg/9ab4833f7c7dd5d4 here]. This patch allows that decision to proceed without losing any current !CherryPy functionality.