We've been redirecting traffic from the bare domain to "www." through a redirect in our DNS setup.
On Jun 2, 1:33 am, Hemal Kuntawala <[email protected]> wrote: > Ah my bad, didn't spot that. > > On 2 June 2011 08:38, Aaron Brethorst <[email protected]> wrote: > > > Thanks, but like I said, the traffic is never making it to my app server, > > leaving any Rack middleware option unusable. > > > On Jun 2, 2011, at 12:36 AM, Hemal Kuntawala wrote: > > > I've got a before hook in my Sinatra app: > > > before do > > if request.env['HTTP_HOST'] == "APP_NAME.heroku.com" || > > request.env['HTTP_HOST'] == "APP_NAME.com" > > redirect > > "http://www.APP_NAME.com#{request.fullpath}<http://www.APP_NAME.com/#%7Brequest.fullpath%7D>", > > 301 > > end > > end > > > My rails knowledge is zero, but I'm guessing* you can write a before_filter > > method in the ApplicationController to do something smiliar? Not sure if my > > method is the best way either. > > > *I'm literally making this up. > > > On 2 June 2011 04:12, Aaron Brethorst <[email protected]> wrote: > > >> I remember a couple weeks back we were strongly advised to send all > >> traffic to "www." instead of a bare domain. What is the best way to ensure > >> this happens? I would do this at the Rack middleware level, but I'm getting > >> frequent reports of 'server not responding' errors from users when they try > >> accessing the site, which means the Rack option is right out. > > >> Thanks, > >> Aaron > > >> -- > >> You received this message because you are subscribed to the Google Groups > >> "Heroku" 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/heroku?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Heroku" 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/heroku?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Heroku" 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/heroku?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Heroku" 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/heroku?hl=en.
