I've never touched Ruby or Rails and I have a relatively simple task to execute. I have an old site and a new site my company is launching. I want to map the URLs from the old site, so if anyone visits them, there is a 301 redirect to the URLs on the new site. i.e.
oldsite.com/ --> newsite.com/
oldsite.com/people --> newsite.com/team
oldsite.com/companies --> newsite.com/companies
and if and if anyone enters a random / old URL they are redirected to the new site homepage. e.g.
oldsite.com/anyoldurl --> newsite.com/
How would I make these changes? This is what the routes.rb file currently looks like:
CompanyName::Application.routes.draw do
match 'admin/' => 'admin#authenticate', :as => :admin
match 'logout/' => 'admin#logout'
resources :people
resources :companies
match 'jobs/' => "companies#jobs", :as => :jobs
match 'platformpm' => 'welcome#platformpm'
match 'analyst' => 'welcome#analyst'
#Experimental Jobs Page
match 'jobs-experimental/' => "companies#jobs_experimental", :as => :jobs_experimental
match 'jobs-experimental/renew' => "companies#jobs_experimental_renew", :as => :jobs_experimental_renew
match 'giftguide' => "welcome#gift_guide"
get 'positions' => redirect('/jobs/')
get 'positions/:id' => redirect('/jobs/')
get 'peoples' => redirect('/people')
root :to => "welcome#index"