Created
August 23, 2012 18:24
-
-
Save scottmessinger/3439910 to your computer and use it in GitHub Desktop.
Change to hlavka for routing
This file contains 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 :ensure_domain | |
APP_DOMAIN = 'www.commoncurriculum.com' | |
STAGING_DOMAIN = 'hlavka-staging.herokuapp.com' | |
def ensure_domain | |
if request.env['HTTP_HOST'] != APP_DOMAIN && request.env['HTTP_HOST'] != STAGING_DOMAIN && Rails.env != 'development' | |
# HTTP 301 is a "permanent" redirect | |
redirect_to "http://#{APP_DOMAIN}", :status => 301 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment