Created
January 11, 2016 18:29
-
-
Save kbaum/b62cadbfb47ca0c6d38b to your computer and use it in GitHub Desktop.
Revisions
-
kbaum created this gist
Jan 11, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ def query_params_to_query(request) query_params = request.params.except(:path, :format) query_params.any? ? "?#{query_params.to_query}" : "" end #redirect apex http://viewthespace.com http://vts.com domain to www.vts.com constraints(host: %r{^vts.com}) do redirect_action = ->(params, _request) do "https://www.vts.com/#{params[:path]}#{query_params_to_query(_request)}" end root to: redirect(redirect_action) match '/*path', to: redirect(redirect_action) end