Skip to content

Instantly share code, notes, and snippets.

@beneggett
Created June 12, 2012 00:42
Show Gist options
  • Save beneggett/2913686 to your computer and use it in GitHub Desktop.
Save beneggett/2913686 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :check_host
def check_host
if request.host.split('.')[0] == 'www'
redirect_to "http://" + request.host.gsub('www.','')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment