Created
April 22, 2009 18:36
-
-
Save nathanbertram/99966 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
# The lazy man way to force www if you don't want to touch apache configs | |
def force_www | |
redirect_to "http://www.#{request.env['HTTP_HOST']}#{request.env['PATH_INF0']}" unless request.env['SERVER_NAME'] =~ /^www./ | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment