I have a site, say, example.com, which is PHP. I am converting it to Rails, but there are three years worth of issues (like magazine issues) that I don't want to update. Thankfully, it seems that I chose an advantageous url format, ie. all issues start with two digits, then the name of the file in most cases

> 
> example.com/00/author-name/index.php  
> 
>  example.com/19/author-name.php
> 
> 
> 

I want to redirect via 301 all requests for those php files to

> 
> archive.example.com
> 
> 
> 

And make the top level example.com a Rails site, serving up the latest issues.. ~/20/author-name 

The subdomain is on dreamhost, and the top level will go to heroku. (So this is not part of the question.) Thanks.