2011/8/12 Richard Harvey <[email protected]>:
> Hi guys,
>
> This may have been asked before but I can't seem to find a reference
> to it. I'm running the skeleton code at the moment and have this:
>
> urls = (
>  '/', 'index'
> )
>
> Which if i understand correctly calls the index class when a GET is
> called on /
>
> however is it possible to modify the code so that a GET on / when
> using the URL http://example.com/ calls a different page to if you
> access the same IP but via http://anothersite.com/

You can use web.ctx.site to find that.

One way is to use an if condition in your index class.

Another way is to create 2 different applications and combine them
using subdomain_application.

mapping = (
    "blog.example.com", blog_app,
    ".*", default_app
)
app = web.subdomain_application(mapping)

Anand

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to