Created
June 12, 2012 00:42
-
-
Save beneggett/2913686 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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