Skip to content

Instantly share code, notes, and snippets.

@icebreaker
Created May 13, 2011 09:25
Show Gist options
  • Select an option

  • Save icebreaker/970248 to your computer and use it in GitHub Desktop.

Select an option

Save icebreaker/970248 to your computer and use it in GitHub Desktop.
match = request.env['REQUEST_URI'].match(/(\/.*)/)
if match
redirect "http://www.#{host}#{match[1]}",301
else
redirect "http://www.#{host}/",301
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment