The parametric router cannot do this but the regular web2py routing
does.
Here is an example
routes_in = (
('.*:https?://yourdomain.com:(GET|POST) /$anything','/app/
$anything'),
)
the .* means the route applies to all client IPs. https? means you
take both http and https. (GET|POST) means the route applies to both
GET and POST. The final part does the mapping.
On Jan 10, 9:14 am, Carlos <[email protected]> wrote:
> Hi,
>
> My environment: latest web2py, ubuntu, postgresql, nginx, uwsgi.
>
> I need to handle multiple subdomains:
>
> http:// sub.domain.com / *args ? vars*
>
> All of them must internally point to the following url structure:
>
> http://www.domain.com/ app / controller / function / sub / *args ? vars
> *
>
> The whole url path (domain, app, controller, function) will be exactly the
> same in all subdomain cases, but each subdomain must be passed as the first
> arg (plus all the other args and vars), and it must handle incoming and
> outgoing urls.
>
> Examples:
>
> from: http:// test.domain.com /
> to: http://www.domain.com/ app / controller / function / test
>
> from: http:// demo.domain.com / *arg1 / arg2 ? var1=1 & var2=2*
> to: http://www.domain.com/ app / controller / function / demo / *arg1
> / arg2 ? var1=1 & var2=2*
>
> Should this be somehow solved with web2py's parameter or pattern based
> routes?.
>
> Your help is greatly appreciated, thanks!
>
> Carlos