If you are using heroku and if you have enabled https then site must be
redirected to use www . It means all Rails applications should ensure that
"no-www" urls are redirected to "www".
In Rails3 it is pretty easy to do. Here is how it can be done.
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

Written byNeeraj Singh
Related blogs
- 01Debugging a Stack Overflow in Rails 7.2.1.1November 25, 2025 · Vishnu M
- 02Active Record adds support for deprecating associationsJuly 3, 2025 · Chirag Shah
- 03Active Job ContinuationsJune 9, 2025 · Vishnu M
- 04Understanding Queueing TheoryJune 3, 2025 · Vishnu M