Old site migration and keeping links (as aliases) I'm migrating an older site into Drupal 7 and have had a lot of success so far. One item where I'm stumped is on links to user profiles. The older system would link to teachers via 

site.edu/faculty.php?PID=FirstnameLastname

Might there be a way to effectively copy that URL as the page's alias faculty.php?PID=FirstnameLastname? And yes, is there a way to escape the http encodings (?, =, and &amp;)?
There's no real need to escape the URI string.

Here's one way to handle this:


In a custom module, implement hook_menu(), creating an item for the path 'faculty.php'
In your php function callback for the above path, look at the PID value, look up the new path (you do have a database table mapping old content to new content, right? :) ), and do a 301 redirect.


Another approach is to do this lookup on all 404 pages with something like the following code in a hook_init():

function hook_init() {
  if (!menu_get_item($_GET['q'])) {
    $pid = isset($_GET['PID']) ? $_GET['PID'] : FALSE;

    if ($pid) {
      // lookup new path and 301 to it
    }
  }
}