Issue: You have installed Magento 1.6.x template and sample date but your website redirects to some another URL like http://localhost/magento.
Solution: due to the Magento 1.6 core updates you don’t have ability to work with customise admin url through the parameter base_url any more. After the sample data installation you can have issue with wrong store URL. To resolve the issue please do the following:
1. When you are done installing Magento template sample data please re-run Magento engine installation procedure. Open app/etc folder and remove local.xml file. Then in your browser type your store address, you’ll see the initial installation screen.
2. You can also access your store database using phpMyAdmin tool, open core_config_data table and change web/unsecure/base_url and web/secure/base_url value to the desired ones.