[web2py] Re: routes for subdomain

2010-02-18 Thread Wikus van de Merwe
Jon, you right. If the example.com and all *.example.com prefixed domains are mapped to the same web2py app it shouldn't really matter if the host is rewritten. But then you have to be careful and don't use relative urls when linking between the prefixed and non- prefixed parts. The rules I

[web2py] Re: routes for subdomain

2010-02-17 Thread Wikus van de Merwe
To get what you want you could use this two rules for routes_in: ('.*:https?://domain\.com:get /([a-z]+)/(.*)', r'/init/public/\1/\2') ('.*:https?://([a-z]+)\.domain\.com:get /(.*)', r'/init/\1/\2') See the full doctest example: http://pastebin.com/fe773b3c However, I'm not sure if this is a

Re: [web2py] Re: routes for subdomain

2010-02-17 Thread Jonathan Lundell
On Feb 17, 2010, at 5:38 AM, Wikus van de Merwe wrote: To get what you want you could use this two rules for routes_in: ('.*:https?://domain\.com:get /([a-z]+)/(.*)', r'/init/public/\1/\2') ('.*:https?://([a-z]+)\.domain\.com:get /(.*)', r'/init/\1/\2') See the full doctest example:

Re: [web2py] Re: routes for subdomain

2010-02-17 Thread Jonathan Lundell
On Feb 16, 2010, at 10:38 PM, Thadeus Burgess wrote: example.com/controllerA/function1 - /init/controllerA/function1 example.com/controllerA/function2 - /init/controllerA/function2 example.com/controllerB/function1 - /init/controllerB/function1 example.com/controllerB/function2 -

Re: [web2py] Re: routes for subdomain

2010-02-17 Thread Thadeus Burgess
Thank you everyone! Finally. Wikus van de Merew your a genius. The following routes does it, and if you try to access example.com/dashboard you get a 404. The only change I needed to make was to wildcard the GET/POST at the end. routes_in = ( ('.*:/favicon.ico',

Re: [web2py] Re: routes for subdomain

2010-02-17 Thread Jonathan Lundell
On Feb 17, 2010, at 9:57 AM, Thadeus Burgess wrote: Thank you everyone! Finally. Wikus van de Merew your a genius. The following routes does it, and if you try to access example.com/dashboard you get a 404. This is a good solution in your case because it's easy to specify the other

[web2py] Re: routes for subdomain

2010-02-16 Thread mdipierro
This cannot be done with routes (at least not unless you list all options for c). You can do this with mod-rewrite in apache. On Feb 16, 4:06 pm, Thadeus Burgess thade...@thadeusb.com wrote: No. example.com/$c/$f maps to /init/public/$c/$f and then dashboard.example.com/$f maps to

Re: [web2py] Re: routes for subdomain

2010-02-16 Thread Thadeus Burgess
Can I do it for just one $c then, that is all I need. Every other controller will continue to function normally, this is only a special case controller. -Thadeus On Tue, Feb 16, 2010 at 4:35 PM, mdipierro mdipie...@cs.depaul.edu wrote: This cannot be done with routes (at least not unless

Re: [web2py] Re: routes for subdomain

2010-02-16 Thread Thadeus Burgess
I can't find any apache rewrite rules that work in this manner. Basically i am just trying to get dashboard.example.com to internally rewrite web2py's URL scheme so that it looks at /init/dashboard but the user is still staring at dashboard.example.com in their browser. This means web2py

Re: [web2py] Re: routes for subdomain

2010-02-16 Thread Jonathan Lundell
On Feb 16, 2010, at 3:37 PM, Thadeus Burgess wrote: By the way. routes_in containing ('.*:https://dashboard.example.com:GET /(?any.*)', '/init/dashboard/\gany'), (?Pany... -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this

Re: [web2py] Re: routes for subdomain

2010-02-16 Thread Thadeus Burgess
Thanks. It is not working like expected. It is now going to /init/default/index. ('.*:https://dashboard.example.com:.* /(?Pany.*)', '/init/dashboard/\gany'), -Thadeus On Tue, Feb 16, 2010 at 6:08 PM, Jonathan Lundell jlund...@pobox.com wrote: On Feb 16, 2010, at 3:37 PM, Thadeus Burgess

Re: [web2py] Re: routes for subdomain

2010-02-16 Thread Jonathan Lundell
On Feb 16, 2010, at 4:25 PM, Thadeus Burgess wrote: Thanks. It is not working like expected. It is now going to /init/default/index. You might try experimenting with the doctest in routes.example.py (copy it and main to your routes.py unless it's already there). Going to the default

[web2py] Re: routes for subdomain

2010-02-16 Thread mdipierro
No you just need routes in to rewrite the hostname. Routesout just need to delete dashboard from path. On Feb 16, 5:37 pm, Thadeus Burgess thade...@thadeusb.com wrote: I can't find any apache rewrite rules that work in this manner. Basically i am just trying to get dashboard.example.com to

Re: [web2py] Re: routes for subdomain

2010-02-16 Thread Thadeus Burgess
Ok I have spent way to long on this, I can't get any configuration of routes/mod_rewrite to rewrite the hostname. -Thadeus On Tue, Feb 16, 2010 at 10:51 PM, mdipierro mdipie...@cs.depaul.edu wrote: No you just need routes in to rewrite the hostname. Routesout just need to delete dashboard

Re: [web2py] Re: routes for subdomain

2010-02-16 Thread Jonathan Lundell
On Feb 16, 2010, at 9:31 PM, Thadeus Burgess wrote: Ok I have spent way to long on this, I can't get any configuration of routes/mod_rewrite to rewrite the hostname. I think Massimo is right: you don't have any reason to rewrite the hostname. -Thadeus On Tue, Feb 16, 2010 at

Re: [web2py] Re: routes for subdomain

2010-02-16 Thread Thadeus Burgess
example.com/controllerA/function1 - /init/controllerA/function1 example.com/controllerA/function2 - /init/controllerA/function2 example.com/controllerB/function1 - /init/controllerB/function1 example.com/controllerB/function2 - /init/controllerB/function2 example.com/$anything -