Skip to content

Instantly share code, notes, and snippets.

@weppos

weppos/routes.rb

Created Jan 31, 2016
Embed
What would you like to do?
Rails.application.routes.draw do
# pre
constraints(host: %r{www\.example\.com}) do
get '/', to: redirect('https://example.com')
get '/*path', to: redirect { |params, _| "https://example.com/#{params[:path]}" }
end
# post
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.