I don't know how well documented it is, but
and
are not quite the same thing. The first is should call the "app" method
on your root object and the second should call the "index" method on the
app object.
By default cherrypy has the tools.trailing_slash tool on,
which would redirect from http://hostname/app to http://hostname/app/ if
the trailing slash is missing after an index handler, but that doesn't
help you much for POSTs.
On the bright side you can post to http://hostname/app/ and it will work
just like http://hostname/app/index
I hope this was helpful.
Jason
The trailing_slash tool, by default, performs an external redirect only
for missing slashes. So the last case, which has an extra slash,
redirects "index/" to "index" (which is then handled by root.app.index),
but it does so internally, without using HTTPRedirect.
The first case, which is missing a slash, may not be reaching CherryPy
at all depending on your deployment (e.g. mod_rewrite rules). How are
you mounting the app and with what args? quickstart(...)?
tree.mount(...)?
See the (new)
http://www.cherrypy.org/wiki/ErrorsAndExceptions#RedirectingPOST section
for more info on redirecting POST requests.
Robert Brewer
fuma...@aminus.org