Skip to content

Instantly share code, notes, and snippets.

@lindblom
Created June 29, 2011 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lindblom/1054203 to your computer and use it in GitHub Desktop.
Save lindblom/1054203 to your computer and use it in GitHub Desktop.
get '/*' do
if request.host =~ /^www/
redirect "http://" + request.host.gsub('www.','') + request.path, 301
else
redirect "http://www." + request.host + request.path, 301
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment