i wonder if this works:

import os
os.environ['REAL_SCRIPT_NAME'] = ""

on top of everything

On Sep 28, 2:21 am, tomekM <[EMAIL PROTECTED]> wrote:
> Hello.
>
> May I ask how do you deal with url rewriting? I have in my app rewrite rule
> like this:
>
> /apps/(.*) --> /web.cgi/$1
>
> But, when I use web.url() to prepare hrefs, I'm getting /web.cgi/sth/foo,
> instead of /apps/sth/foo.
> This is because web.ctx.homepath is initialized by env['SCRIPT_NAME'].
>
> I made a workaround for this by a simple fix in application.py in function
> load():
>
> changed:
> ctx.homepath = os.environ.get('REAL_SCRIPT_NAME', env.get('SCRIPT_NAME',
> ''))
> to:
> if not ctx.homepath: ctx.homepath = os.environ.get('REAL_SCRIPT_NAME',
> env.get('SCRIPT_NAME', ''))
>
> Now I can preset web.ctx.homepath to anything I want ('/apps' in my case)
> before invoking app.run(), and I'm set.
>
> What do you think about this?
>
> Regards,
> tomekM
>
> --
> If you had one shot, or one opportunity
> To seize everything you ever wanted - One moment
> Would you capture it or just let it slip?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to