How to set up the SQL Server to read a database from external hard disk or a different hard disk from my PC
You will want to use the MOVE option in the restore command to tell the restore process where to put each of the files in the backup set. This is done for each logical file name specifying the new physical location. 

See the details in this technet article 

It also shows how to get the logical file names from the backup set.