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 -> /init/defaultController/$anything
dashboard.example.com/function1 -> /init/dashboard/function1
dashboard.example.com/function2 -> /init/dashboard/function2
dashboard.example.com/$anything -> /init/dashboard/$anything

Any of the above URLS should work.

You should NOT be able to do the following, dashboard controller
should only be accessed by this single subdomain.

!example.com/init/dashboard/function1

I don't care if I have to declare every controller in routes... I
would have to do that in django/werkzeug/ruby/php/etc. I'm ready for
web2py to get out of my way and let me do what I want to do.

When I said rewrite hostname I ment to redirect a single hostname to a
single web2py controller. This is the same concept as example1.com
goes to app1 and example2.com goes to app2, but on the controller
level instead of app level! (because the controllers share models)

Hopefully this gets my point across.

-Thadeus





On Wed, Feb 17, 2010 at 12:03 AM, Jonathan Lundell <jlund...@pobox.com> wrote:
> 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 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 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 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 routes_out
>>>> will have to rewrite to the domain schema as well.
>>>>
>>>> it is not looking like I can accomplish this with routes or mod_rewrite.
>>>>
>>>> Massimo you have said you can redirect to two different apps depending
>>>> on http_host, isn't this a similar situation?
>>>>
>>>> By the way.
>>>>
>>>> routes_in containing
>>>>
>>>> ('.*:https://dashboard.example.com:GET/(?<any>.*)', 
>>>> '/init/dashboard/\g<any>'),
>>>>
>>>> produces
>>>>
>>>> Traceback (most recent call last):
>>>> [Tue Feb 16 16:14:58 2010] [error] [client   File
>>>> "/home/servant/sites/themediapanel.com/public/web2py/wsgihandler.py",
>>>> line 24, in <module>
>>>> [Tue Feb 16 16:14:58 2010] [error] [client      import gluon.main
>>>> [Tue Feb 16 16:14:58 2010] [error] [client ]   File "gluon/main.py",
>>>> line 105, in <module>
>>>> [Tue Feb 16 16:14:58 2010] [error] [client ]     rewrite.load()
>>>> [Tue Feb 16 16:14:58 2010] [error] [client]   File "gluon/rewrite.py",
>>>> line 65, in load
>>>> [Tue Feb 16 16:14:58 2010] [error] [client
>>>> params.routes_in.append((re.compile(k, re.DOTALL), v))
>>>> [Tue Feb 16 16:14:58 2010] [error] [client]   File
>>>> "/usr/lib/python2.6/re.py", line 190, in compile
>>>> [Tue Feb 16 16:14:58 2010] [error] [client ]     return _compile(pattern, 
>>>> flags)
>>>> [Tue Feb 16 16:14:58 2010] [error] [client ]   File
>>>> "/usr/lib/python2.6/re.py", line 245, in _compile
>>>> [Tue Feb 16 16:14:58 2010] [error] [client ]     raise error, v #
>>>> invalid expression
>>>> [Tue Feb 16 16:14:58 2010] [error] [client] error: syntax error
>>>>
>>>> -Thadeus
>>>>
>>>> On Tue, Feb 16, 2010 at 5:06 PM, Thadeus Burgess <thade...@thadeusb.com> 
>>>> wrote:
>>>>> 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 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
>>>>
>>>>>>> /init/dashboard/$f
>>>>
>>>>>>> I basically want
>>>>
>>>>>>> $c.example.com/$f
>>>>
>>>>>>> /init/$c/$f
>>>>
>>>>>>> As I say this I kind of remember a post about this, search failing me.
>>>>
>>>>>>> -Thadeus
>>>>
>>>>>>> On Tue, Feb 16, 2010 at 4:02 PM, Wes James <compte...@gmail.com> wrote:
>>>>>>>> forgot right bracket ]....
>>>>
>>>>>>>> On Tue, Feb 16, 2010 at 2:59 PM, Wes James <compte...@gmail.com> wrote:
>>>>>>>>> On Tue, Feb 16, 2010 at 2:42 PM, Thadeus Burgess 
>>>>>>>>> <thade...@thadeusb.com> wrote:
>>>>>>>>>> I need to take the following with routes
>>>>
>>>>>>>>>> controller.website.com/action/args
>>>>
>>>>>>>>>> and convert it to
>>>>
>>>>>>>>>> /init/controller/action/args
>>>>
>>>>>>>>>> How can I do this, I have attempted to copy the book example however
>>>>>>>>>> it is just giving syntax errors.
>>>>
>>>>>>>>> This is a guess based on an example I saw:
>>>>
>>>>>>>>> routes_in=[('/init/controller/action/args','/action/args')
>>>>
>>>>>>>>> -wes
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to