This redirecting problem is indeed annoying, I usually "solve" it by changing an
environment variable, for example like this:

os.environ['REAL_SCRIPT_NAME'] = '/webpy_bug_report/'

This environment is the source for the prefixes of webpy's redirects.

I would love if there would be a solution that works across all web servers and
systems, I do not have enough experience with different setups though.

Maybe the easiest addition to webpy would be a web.config setting like
"base_url" that would be used in preference over the environment variable.

Bests,
Dragan

Am 29.01.2012 21:26, schrieb Alex Quinn:
> Below is a stripped down example that illustrates the problem.  If I
> go to http://example.com/webpy_bug_report/ it works fine.  If I go to
> http://example.com/webpy_bug_report/redirect/ I expect to be
> redirected to http://example.com/webpy_bug_report/ but instead I am
> redirected to http://example.com/webpy_bug_report/redirect_problem.py/.
> I've tried this under plain CGI as well as FastCGI.
> 
> Upon further testing, I realized my current fix doesn't quite work.
> If this is indeed a bug, I'd be happy to take another try at fixing
> it.  However, it seems like this would have come up for others
> before.  I couldn't find anything in the list archives or the issue
> tracker.  If I'm doing something wrong or if I missed a solution
> online somewhere, I'd be most grateful if somebody could point me in
> the right direction.
> 
> Thanks,
> Alex
> 
> 
> ___________________________________________________________
> # .htaccess
> 
> RewriteEngine on
> RewriteBase /webpy_bug_report/
> RewriteCond %{REQUEST_URI} !^/webpy_bug_report/favicon.ico$
> RewriteCond %{REQUEST_URI} !^(/.*)+redirect_problem.py/
> RewriteRule ^(.*)$ redirect_problem.py/$1 [PT]
> 
> 
> ___________________________________________________________
> # redirect_problem.py
> 
> import web
> 
> urls = (
>     '/',         'index',
>     '/redirect/','redirect'
> )
> 
> class index:
>     def GET(self):
>         return "This is the index page."
> 
> class redirect:
>     def GET(self):
>         raise web.seeother('/')
> 
> app = web.application(urls, globals())
> 
> if __name__ == '__main__':
>     app.run()
> 

-- 
http://noobz.cc/
http://digitalfolklore.org/
http://contemporary-home-computing.org/1tb/

-- 
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