title: Page redirecting in a web application at server side
body: <p>I have two websites say</p>
  
  <pre><code>1. firstwebsite.com
  2. secondwebsite.com
  </code></pre>
  
  <p>All the pages in firstwebsite are static. Now I want to move all pages in firstwebsite.com to secondwebsite.com. I want to shutdown all servers of firstwebsite.com</p>
  
  <p>I also want to make sure that when the URL firstwebsite.com/** should redirect to secondwebsite.com/**</p>
  
  <p><strong>firstwebsite.com/abc.html should redirect to secodnwebsite.com/abc.html</strong></p>
  
  <p>I am using springs. Can some one guide me how to do it. Later I also want to do some processing based on device from which request is sent.</p>
  
  <p>It would be really great if I can get some references for above.</p>