I have uploaded my website on live server from localhost in magento
and when i m writing the url e.g: http://unbeatablewatches.com it is redirecting to localhost/unbeata
Once I faced similar problem and the trick was I forgot to update local.xml files. I know it's old thread but if anyone runs into that.
You need to change urls in database.
Table core_config_data
You need to look for this values in path column:
web/secure/base_url
web/unsecure/base_url
And change their values to https://unbeatablewatches.com for secure and http://unbeatablewatches.com for unsecure.
I don't know if you have some access to the database, it would be good if you could use phpmyadmin.
You can use command
$ bin/magento setup:store-config:set --base-url=your.magento.url
$ bin/magento setup:store-config:set --base-url-secure=your.magento.url
to set site urls.
I faced this issue and solved it using following steps.
1. Change base_url
Navigate to the core_config_data
table in your database and add
your store url to the value column of following path
column.
web/secure/base_url
web/secure/base_link_url
web/unsecure/base_url
web/unsecure/base_link_url
2. Clear log entries
Run following SQL query in order to truncate log tables.
TRUNCATE dataflow_batch_export;
TRUNCATE dataflow_batch_import;
TRUNCATE log_customer;
TRUNCATE log_quote;
TRUNCATE log_summary;
TRUNCATE log_summary_type;
TRUNCATE log_url;
TRUNCATE log_url_info;
TRUNCATE log_visitor;
TRUNCATE log_visitor_info;
TRUNCATE log_visitor_online;
TRUNCATE report_viewed_product_index;
TRUNCATE report_compared_product_index;
TRUNCATE report_event;
TRUNCATE index_event;
The answer that vasily-l posted is some what correct and worked for me.
However, protocols are required as per the magento documentation otherwise you will receive errors stating that the url is invalid. A trailing slash should also be used:
$ bin/magento setup:store-config:set --base-url="http://www.example.com/"
$ bin/magento setup:store-config:set --base-url-secure="https://www.example.com/"
The commands should be run from the magento root directory.
It is also best to note that these commands would be for Magento 2.x not Magento 1.x
Source: Magento DevDocs: Configure the store
PS: Didn't have enough rep to comment.
It was the same problem, fixed by changing in the database WHERE path='web/secure/base_url' AND path='web/unsecure/base_url'
set scope_id=0
and scope=default
besides defining the url
SELECT * FROM magcore_config_data WHERE path='web/secure/base_url'
SELECT * FROM magcore_config_data WHERE path='web/unsecure/base_url'