On 28 Dec 2012, at 12:56 PM, HittingSmoke <[email protected]> wrote: > I'm using my host's shared nginx instance to serve web2py through uwsgi to > save RAM and keep responsiveness up. I can't really do any server-side > configuration that isn't through uwsgi or web2py without building my own > nginx instance unfortunately. > > I really like the simplicity of the parametric router so I was hoping it > would be possible there. Maybe it's something that could be added to the > newer router at some point.
Here's something you can do without any routing at all: first thing in your model, check the hostname for www, and call redirect() with an edited (to remove the www.) of the incoming URL. It's not as efficient as doing it in the server itself, it's not much overhead, and for a 301 it isn't all that critical anyway. > > On Friday, December 28, 2012 7:39:36 AM UTC-8, Jonathan Lundell wrote: > On 27 Dec 2012, at 10:31 PM, HittingSmoke <[email protected]> wrote: >> Pretty straight forward question. Can I use the parametric routes.py >> language to 301 redirect from www.domain.com to domain.com for proper search >> engine crawling? >> >> > > You'd be better off configuring your server to do that. If you want to use > web2py routes, I think you need the pattern-matching router. > > --

