hi, i''ve got my app running on a dedicted linux box running lighttpd. i have an ssl certificate installed and if i go to https://mysite.com then i get to view the site over a secure connection as expected. however, if the user just enters www.mysite.com then the browser will use http: by default instead of https:. does anyone know how to force connections to use https, or how to redirect urls with http: to their https: equivalent? -john -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> i''ve got my app running on a dedicted linux box running lighttpd. > > i have an ssl certificate installed and if i go to https://mysite.com > then i get to view the site over a secure connection as expected. > > however, if the user just enters www.mysite.com then the browser will > use http: by default instead of https:. > > does anyone know how to force connections to use https, or how to > redirect urls with http: to their https: equivalent?Somewhere within the ''request'' object there''s got to be a protocol attribute. If that''s not "https" then redirect them. You could do this check as a before_filter in application.rb to cover all your bases. -philip --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 1/24/07, Philip Hallstrom <rails-SUcgGwS4C16SUMMaM/qcSw@public.gmane.org> wrote:> > > i''ve got my app running on a dedicted linux box running lighttpd. > > > > i have an ssl certificate installed and if i go to https://mysite.com > > then i get to view the site over a secure connection as expected. > > > > however, if the user just enters www.mysite.com then the browser will > > use http: by default instead of https:. > > > > does anyone know how to force connections to use https, or how to > > redirect urls with http: to their https: equivalent? > > Somewhere within the ''request'' object there''s got to be a protocol > attribute. If that''s not "https" then redirect them. You could do this > check as a before_filter in application.rb to cover all your bases. > > -philip > > > >Philip, The ssl_requirement plugin by DHH is highly recommended for this type of thing. Very easy to use. Repos: http://dev.rubyonrails.org/browser/plugins/ssl_requirement Install: $./script/plugin install ssl_requirement -- Zack Chandler http://depixelate.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---