title: Reroute old content (.html/.php etc.) to Ruby on Rails
body: <p>I have switched to Ruby on Rails and my current problem is to reroute
  the old contents like <code>XXX/dummy.html</code> or <code>XXX/dummy.php</code> in RoR.</p>
  
  <p>What exactly is the best solution for</p>
  
  <ol>
  <li>isolated content (<code>XXX/onlyinstance.html</code>)  </li>
  <li>content which has a internal structure like <code>XXX/dummy1.html</code>, <code>XXX/dummy2.html</code></li>
  </ol>
  
  <p><a href="http://guides.rubyonrails.org/routing.html" rel="nofollow noreferrer">http://guides.rubyonrails.org/routing.html</a> does not explain how to
  migrate old content.</p>
  
  <p>Note: Changing the old links is NOT an option. The website is hosted, it is not my
  own server. As the domain hasn't changed, the solution to redirect it seems to be
  unnecessary...there should be a better solution.</p>
  
  <p>EDIT: I have found out that the best solution is in fact rerouting it by the way weppos described.</p>
  
  <p>So add a .htaccess file in the public directory
  and write</p>
  
  <p>RewriteEngine on<br>
  Redirect permanent /XXX.php <a href="http://XYZ/XXX" rel="nofollow noreferrer">http://XYZ/XXX</a></p>
  
  <p>For whatever reason, RoR did not accept rerouting in routes.rb...while .html/.xml
  all goes fine, .php does not function. I haven't found out why. Because weppos answer
  was the best, I will award him a 50 point bounty, but as the others answers are valid,
  too, I will upvote them. Thank you all</p>