Skip to content

Instantly share code, notes, and snippets.

@julionc
Created November 28, 2012 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julionc/4158704 to your computer and use it in GitHub Desktop.
Save julionc/4158704 to your computer and use it in GitHub Desktop.
Redirect to Www for Heroku With SSL
# Taken from http://blog.bigbinary.com/2012/10/12/redirect-to-www-heroku-ssl.html
Bigbinary::Application.routes.draw do
constraints(:host => /^bigbinary.com/) do
root :to => redirect("http://www.bigbinary.com")
match '/*path', :to => redirect {|params| "http://www.bigbinary.com/#{params[:path]}"}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment