You can use the regex: (?P<domain>.*?)

routes_in = (
 ('140\.191\.\d+\.\d+:https://(?P<domain>.*?):POST /(?P<any>.*)
\.php',
  '/test/default/index?vars=\g<any>&domain=\g<domain>'),
)

On May 10, 1:00 am, Dan <[email protected]> wrote:
> Hi Massimo,
>
> thanks a lot for your quick reply. I need the domain/hostname in the
> second part of routes_in. I can't hard code the domain name because of
> out build system. routes_in have to use the current domain or some
> kind of wildcard.
>
> Is there any way?
>
> Thanks again.
>
> On May 10, 3:57 am, Massimo Di Pierro <[email protected]>
> wrote:
>
>
>
>
>
>
>
> > It depends. You can 
> > dohttp://web2py.com/book/default/chapter/04?search=routes#Pattern-Based...
>
> > routes_in = (
> >  ('140\.191\.\d+\.\d+:https://www.web2py.com:POST/(?P<any>.*)\.php',
> >   '/test/default/index?vars=\g<any>'),
> > )
>
> > You can have regex in pattern for hostname
>
> > On May 9, 3:45 pm, Dan <[email protected]> wrote:
>
> > > Hi,
>
> > > is there any way to get the current domain in routes.py? The request
> > > object is not defined in routes.py.
>
> > > The reason for this is that I want to build some links over https with
> > > routes_out. Since you have to give a full URL as the second parameter
> > > I need to prepend the domain.
>
> > > Thanks a lot for any help.

Reply via email to