PROBLEM
It seems that web.redirect (and web.seeother, etc.) break the URL
scheme when used in conjunction with an Apache URL rewriting.  I set
up a slight modification of the Todo example (http://webpy.org/src/
todo-list/0.3) and used the Apache redirect to hide the ".../todo.py/"
from the URLs.  When it hits the web.redirect("/"), instead of
redirecting to http://example.com/todo/, it redirects to
http://example.com/todo/todo.py/.  Besides making my clean URLs dirty
again, that also breaks relative URLs to static content.

SOLUTION
I'd like to offer a very small patch that solves the problem.  The
core issue seems to be that web.redirect (webapi.py) adds web.ctx.home
to the front of the given URL, and web.home is constructed using the
SCRIPT_NAME environment variable instead of REQUEST_URI.  SCRIPT_NAME
is apparently not affected by the Appache rewrite.  For SCRIPT_NAME, I
get "/todo_test/todo.py".  For REQUEST_URI, I get "/todo_test/" (or
something like that).

QUESTIONS
Would a patch be welcome?
Should I open a ticket in the issue tracker?
Would a stripped-down example of the issue help clarify this?

Huge Kudos to Aaron and others for making Web.py so easy to use *and*
so easy to modify!  The code was remarkably clear and easy to navigate.

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to webpy@googlegroups.com.
To unsubscribe from this group, send email to 
webpy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to