Skip to content

Instantly share code, notes, and snippets.

@ace-subido
Created March 27, 2014 09:37
Show Gist options
  • Save ace-subido/9803796 to your computer and use it in GitHub Desktop.
Save ace-subido/9803796 to your computer and use it in GitHub Desktop.
Redirect to an external website when link could not be found in your Rails App
AelogicaSite::Application.routes.draw do
# Insert all your base here
get '/404', :to => redirect { |params, request|
domain = 'http://yey.com'
"http://#{domain}/#{request.env["REQUEST_PATH"]}"
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment