Search and replace with a good editor would work. Otherwise you'd have to route all the requests through PHP and have that search and replace the links which would just load the server for no reason. Using an editor is a one time event (just make backups first!!).