William Dode wrote:
> Hi,
> 
> When i use my application through apache proxy i need to retreive a part 
> of the referer, to know the root of my application (i don't know the 
> exact terms...)
> 
> For example i have
> 
> http://mydomain.tld/myapp/mypage
> 
> with this .htaccess in www/myapp/
> RewriteRule (.*) http://localhost:8888/$1 [P]
> 
> I want to retreive /myapp
> 
> So i do
> 
> '/'+'/'.join(req.referer.split('/')[3:])
> 
> Is there a better solution ? Maybe a helper in webob ?

I suspect you want something like PrefixMiddleware in PasteDeploy -- 
this lets you configure the base URL of your application.  It's just a 
middleware that overwrites the values of things like HTTP_HOST, 
SCRIPT_NAME, etc, according to your configuration.

Everything works better in my experience if you fix the request right 
away to make it correct.

-- 
Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org
             : Write code, do good : http://topp.openplans.org/careers

_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to