Skip to content

Instantly share code, notes, and snippets.

@stephensprinkle-zz
Created April 17, 2012 02:32
Show Gist options
  • Save stephensprinkle-zz/2403020 to your computer and use it in GitHub Desktop.
Save stephensprinkle-zz/2403020 to your computer and use it in GitHub Desktop.
Test for SSL + Subdomain in Rails Controller to Remove SSL + Subdomain
before_filter :no_secure_subdomain_ssl
def no_secure_subdomain_ssl
if request.subdomain == 'secure' or request.ssl? == true
redirect_to root_url(:host => request.domain, :protocol => 'http' )
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment