Skip to content

Instantly share code, notes, and snippets.

@leemcalilly
Created March 1, 2012 17:16
Show Gist options
  • Save leemcalilly/1951491 to your computer and use it in GitHub Desktop.
Save leemcalilly/1951491 to your computer and use it in GitHub Desktop.
unless RAILS_ENV == "development"
before_filter :add_www_subdomain
end
private
def add_www_subdomain
unless /^www/.match(request.host)
redirect_to("#{request.protocol}www.achievenext.com#{request.request_uri}",
:status => 301)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment