Re: [web2py] Re: Subdomain Duplicates Content
for the record: to solve the problem with google robots you can set robot.txt to allow/deny other apps.
Re: [web2py] Re: Subdomain Duplicates Content
On Jun 4, 2011, at 9:21 AM, Francisco Costa wrote: > > Are this changes in the new version? Yes. > > On May 28, 3:50 pm, Jonathan Lundell wrote: >> There's support for exclusive domain mapping enforcement in the trunk now. >> It'd be good if someone could try it out, because the unit tests I was able >> to come up with aren't all that close to a real-world environment. >> >> Just set exclusive_domain=True in the BASE router (for all domains) or an >> app router (for that apps's domain). You'll get a SyntaxError exception if >> you call URL() to generate a URL for a different app unless you explicitly >> provide a host= argument to URL. >> >> Or at least that's the intention. >> >> BTW, WRT the issue of search engines being confused by multiple URLs >> pointing to the same pages, you might want to investigate Google's >> canonical-host logic. It may not be helpful, in that it might deal only with >> complete domain duplication (egwww.domain.comand domain.com) rather than >> overlapping subsets of domains; I'm not sure.
Re: [web2py] Re: Subdomain Duplicates Content
On May 26, 2011, at 2:08 AM, Francisco Costa wrote: > > any update on this? No, I just got back from a trip and haven't looked at it. Can we discuss what behavior we want (and can get)? The easiest option: a flag to forbid a cross-domain URL call. URL would raise an exception if you try to do that. (Actually, the rewrite logic would do that.) What's not so easy is to add a domain to the generated URL. Right now, the rewrite logic never adds a domain (and there's no mechanism to do so), and in fact doesn't even see the host & port arguments that URL() is called with. This is in large part because of the historical divide between URL() itself and the routing logic. Note also that it's not obvious which domain to associate with an outgoing URL, since multiple domains can map to a single app (more generally multiple host:port combinations), so we'd have to tag one domain as the "master" domain for outgoing URLs in a given app (maybe by convention the first one specified?). And we'd have to know whether to make it http or https. > > On May 24, 2:36 am, Jonathan Lundell wrote: >> On May 23, 2011, at 8:06 PM, Bruno Rocha wrote: >> >>> I guess Francisco wants to explain a different behaviour. >> >>> Having 2 or more apps on the same web2py instance, web2py should prevent >>> the app to be requested by other domain than its own domain. >> >>> www.app1.com-> /app1 #allowed >>> www.app2.com-> /app2 #allowed >> >>> www.app1.com/app2-> /app2 # denied >>> www.app2.com/app1-> app1 # denied >> >>> I agree with him, sometimes search robots finds apps under different >>> domains... >> >> We can do that, I think, easily enough. But I'm not so sure about >> automatically generating an absolute URL in UIRL() for a "foreign" >> domain-app combination. Maybe... >> >> >> >> >> >> >> >> >> >>> -- >>> Bruno Rocha >>> [ About me:http://zerp.ly/rochacbruno] >> >>> On Mon, May 23, 2011 at 9:40 PM, Jonathan Lundell >>> wrote: >>> On May 23, 2011, at 6:10 PM, Francisco Costa wrote: >> The URL calling is fine.. the problem is how web2py manages different apps from different domains/subdomains >> I really believe that they should be improved! >> >>> web2py (URL) isn't generating a domain *at all* in the URL unless you >>> explicitly specify one; the domain is normally provided by the browser, and >>> that's how it should be, at least by default. If you want to override the >>> domain the browser is using, you need to do it explicitly. >> On May 23, 11:02 pm, Jonathan Lundell wrote: > What's your URL() call for the example below? Have you looked at the > HTML? I wouldn't expect to see a domain there at all. >> > On May 23, 2011, at 12:00 PM, Francisco Costa > wrote: >> >> Hello, >> I have a main app and a blog app >> >> My routes.py are like this: >> routers = dict( >>BASE = dict( >>default_application = 'main', >>default_controller = 'default', >>default_function = 'index', >>domains = { >>"domain.com" : "main", >>"blog.domain.com" : "blog", >>} >>) >> ) >> >> While I'm browsing through the subdomain "blog.domain.com" I have some >> links that point to the main app. >> Those links are generated like this: >> http://blog.domain.com/main/test >> >> If I click on it it works, but I would like the link to be generated >> as >> http://domain.com/main/test >> >> This is bad because 2 different domains urls shouldn't target the same >> page and it also duplicates data which is bad for SEO >> >> Any help?
Re: [web2py] Re: Subdomain Duplicates Content
I dont think it is necessary to change URL behaviour, just include the allow/deny lists to the router. -- Bruno Rocha [ About me: http://zerp.ly/rochacbruno ] On Mon, May 23, 2011 at 10:36 PM, Jonathan Lundell wrote: > On May 23, 2011, at 8:06 PM, Bruno Rocha wrote: > > I guess Francisco wants to explain a different behaviour. > > Having 2 or more apps on the same web2py instance, web2py should prevent > the app to be requested by other domain than its own domain. > > www.app1.com -> /app1 #allowed > www.app2.com -> /app2 #allowed > > www.app1.com/app2 -> /app2 # denied > www.app2.com/app1 -> app1 # denied > > I agree with him, sometimes search robots finds apps under different > domains... > > > We can do that, I think, easily enough. But I'm not so sure about > automatically generating an absolute URL in UIRL() for a "foreign" > domain-app combination. Maybe... > > > > -- > Bruno Rocha > [ About me: http://zerp.ly/rochacbruno ] > > > > On Mon, May 23, 2011 at 9:40 PM, Jonathan Lundell wrote: > >> On May 23, 2011, at 6:10 PM, Francisco Costa wrote: >> > >> > The URL calling is fine.. the problem is how web2py manages different >> > apps from different domains/subdomains >> > >> > I really believe that they should be improved! >> >> web2py (URL) isn't generating a domain *at all* in the URL unless you >> explicitly specify one; the domain is normally provided by the browser, and >> that's how it should be, at least by default. If you want to override the >> domain the browser is using, you need to do it explicitly. >> >> > >> > On May 23, 11:02 pm, Jonathan Lundell wrote: >> >> What's your URL() call for the example below? Have you looked at the >> HTML? I wouldn't expect to see a domain there at all. >> >> >> >> On May 23, 2011, at 12:00 PM, Francisco Costa >> wrote: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>> Hello, >> >>> I have a main app and a blog app >> >> >> >>> My routes.py are like this: >> >>> routers = dict( >> >>>BASE = dict( >> >>>default_application = 'main', >> >>>default_controller = 'default', >> >>>default_function = 'index', >> >>>domains = { >> >>>"domain.com" : "main", >> >>>"blog.domain.com" : "blog", >> >>>} >> >>>) >> >>> ) >> >> >> >>> While I'm browsing through the subdomain "blog.domain.com" I have >> some >> >>> links that point to the main app. >> >>> Those links are generated like this: >> >>> http://blog.domain.com/main/test >> >> >> >>> If I click on it it works, but I would like the link to be generated >> >>> as >> >>> http://domain.com/main/test >> >> >> >>> This is bad because 2 different domains urls shouldn't target the same >> >>> page and it also duplicates data which is bad for SEO >> >> >> >>> Any help? >> >> >> > > >
Re: [web2py] Re: Subdomain Duplicates Content
On May 23, 2011, at 8:06 PM, Bruno Rocha wrote: > I guess Francisco wants to explain a different behaviour. > > Having 2 or more apps on the same web2py instance, web2py should prevent the > app to be requested by other domain than its own domain. > > www.app1.com -> /app1 #allowed > www.app2.com -> /app2 #allowed > > www.app1.com/app2 -> /app2 # denied > www.app2.com/app1 -> app1 # denied > > I agree with him, sometimes search robots finds apps under different > domains... We can do that, I think, easily enough. But I'm not so sure about automatically generating an absolute URL in UIRL() for a "foreign" domain-app combination. Maybe... > > > -- > Bruno Rocha > [ About me: http://zerp.ly/rochacbruno ] > > > > On Mon, May 23, 2011 at 9:40 PM, Jonathan Lundell wrote: > On May 23, 2011, at 6:10 PM, Francisco Costa wrote: > > > > The URL calling is fine.. the problem is how web2py manages different > > apps from different domains/subdomains > > > > I really believe that they should be improved! > > web2py (URL) isn't generating a domain *at all* in the URL unless you > explicitly specify one; the domain is normally provided by the browser, and > that's how it should be, at least by default. If you want to override the > domain the browser is using, you need to do it explicitly. > > > > > On May 23, 11:02 pm, Jonathan Lundell wrote: > >> What's your URL() call for the example below? Have you looked at the HTML? > >> I wouldn't expect to see a domain there at all. > >> > >> On May 23, 2011, at 12:00 PM, Francisco Costa > >> wrote: > >> > >> > >> > >> > >> > >> > >> > >>> Hello, > >>> I have a main app and a blog app > >> > >>> My routes.py are like this: > >>> routers = dict( > >>>BASE = dict( > >>>default_application = 'main', > >>>default_controller = 'default', > >>>default_function = 'index', > >>>domains = { > >>>"domain.com" : "main", > >>>"blog.domain.com" : "blog", > >>>} > >>>) > >>> ) > >> > >>> While I'm browsing through the subdomain "blog.domain.com" I have some > >>> links that point to the main app. > >>> Those links are generated like this: > >>> http://blog.domain.com/main/test > >> > >>> If I click on it it works, but I would like the link to be generated > >>> as > >>> http://domain.com/main/test > >> > >>> This is bad because 2 different domains urls shouldn't target the same > >>> page and it also duplicates data which is bad for SEO > >> > >>> Any help? > > >
Re: [web2py] Re: Subdomain Duplicates Content
I guess Francisco wants to explain a different behaviour. Having 2 or more apps on the same web2py instance, web2py should prevent the app to be requested by other domain than its own domain. www.app1.com -> /app1 #allowed www.app2.com -> /app2 #allowed www.app1.com/app2 -> /app2 # denied www.app2.com/app1 -> app1 # denied I agree with him, sometimes search robots finds apps under different domains... -- Bruno Rocha [ About me: http://zerp.ly/rochacbruno ] On Mon, May 23, 2011 at 9:40 PM, Jonathan Lundell wrote: > On May 23, 2011, at 6:10 PM, Francisco Costa wrote: > > > > The URL calling is fine.. the problem is how web2py manages different > > apps from different domains/subdomains > > > > I really believe that they should be improved! > > web2py (URL) isn't generating a domain *at all* in the URL unless you > explicitly specify one; the domain is normally provided by the browser, and > that's how it should be, at least by default. If you want to override the > domain the browser is using, you need to do it explicitly. > > > > > On May 23, 11:02 pm, Jonathan Lundell wrote: > >> What's your URL() call for the example below? Have you looked at the > HTML? I wouldn't expect to see a domain there at all. > >> > >> On May 23, 2011, at 12:00 PM, Francisco Costa > wrote: > >> > >> > >> > >> > >> > >> > >> > >>> Hello, > >>> I have a main app and a blog app > >> > >>> My routes.py are like this: > >>> routers = dict( > >>>BASE = dict( > >>>default_application = 'main', > >>>default_controller = 'default', > >>>default_function = 'index', > >>>domains = { > >>>"domain.com" : "main", > >>>"blog.domain.com" : "blog", > >>>} > >>>) > >>> ) > >> > >>> While I'm browsing through the subdomain "blog.domain.com" I have some > >>> links that point to the main app. > >>> Those links are generated like this: > >>> http://blog.domain.com/main/test > >> > >>> If I click on it it works, but I would like the link to be generated > >>> as > >>> http://domain.com/main/test > >> > >>> This is bad because 2 different domains urls shouldn't target the same > >>> page and it also duplicates data which is bad for SEO > >> > >>> Any help? > > >
Re: [web2py] Re: Subdomain Duplicates Content
On May 23, 2011, at 6:10 PM, Francisco Costa wrote: > > The URL calling is fine.. the problem is how web2py manages different > apps from different domains/subdomains > > I really believe that they should be improved! web2py (URL) isn't generating a domain *at all* in the URL unless you explicitly specify one; the domain is normally provided by the browser, and that's how it should be, at least by default. If you want to override the domain the browser is using, you need to do it explicitly. > > On May 23, 11:02 pm, Jonathan Lundell wrote: >> What's your URL() call for the example below? Have you looked at the HTML? I >> wouldn't expect to see a domain there at all. >> >> On May 23, 2011, at 12:00 PM, Francisco Costa >> wrote: >> >> >> >> >> >> >> >>> Hello, >>> I have a main app and a blog app >> >>> My routes.py are like this: >>> routers = dict( >>>BASE = dict( >>>default_application = 'main', >>>default_controller = 'default', >>>default_function = 'index', >>>domains = { >>>"domain.com" : "main", >>>"blog.domain.com" : "blog", >>>} >>>) >>> ) >> >>> While I'm browsing through the subdomain "blog.domain.com" I have some >>> links that point to the main app. >>> Those links are generated like this: >>> http://blog.domain.com/main/test >> >>> If I click on it it works, but I would like the link to be generated >>> as >>> http://domain.com/main/test >> >>> This is bad because 2 different domains urls shouldn't target the same >>> page and it also duplicates data which is bad for SEO >> >>> Any help?