Please check if you have web root pointed correctly to your domain and check if .htaccess has no extra rewrites.
After doing above setting properly. Change your base_url. You can do it using any of the following method.
Method 1: Magento Admin Panel
- Log in to your Magento Admin Panel.
- On the upper right, click System > Configuration.
- From the menu on the left, under the General list, click Web
- Open the Unsecure and Secure dropdowns, locate the base URL line, and replace this with the new URL.
- Clear the Magento cache and your browser's cache. The site should now load properly.
Method 2: PhpMyAdmin
- Log in to your Cpanel account.
- Open PhpMyadmin.
- You will see the main menu for phpMyAdmin. On the left side of the screen, locate and click the name of the Magento database corresponding to URL you want to change.
- You will see a list of all the tables in the database in alphabetical order. Search for the core_config_data table and click Browse.
- Locate the rows web/unsecure/base_url and web/secure/base_url and click Edit next to the corresponding lines. Change the base URL to the intended string, and click OK.
- Within the Value column, update the value of each specific secure and unsecure URL to the intended URL.
- Flush the Magento cache, and the site should load with the set base URLs properly now.
Method 3: Command line
Attention: Do not attempt to change the base URLs unless you are familiar with the command line and MySQL queries.
- Use SSH to log in to the server hosting the Magento installation's database.
- Enter the following command, where $database_user is the database user and $database_name is the database:
mysql -u $database_user -p $database_name
Enter your password when prompted.
3. Access their database using the following command, where database is the database name.
- Run the following command:
select * from core_config_data where path like '%base%url%';
- This will display the current base_urls set in Magento.
- To change the base URLs, execute the following commands:
update core_config_data set value = 'http://domainname/' where path ='web/unsecure/base_url';
update core_config_data set value = 'http://domainname/' where path = 'web/secure/base_url';
For more details go to this link.