Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento is automatically redirecting to localhost on live server

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/unbeatable-watches..

how to solve this issue .. ?

please help me

like image 703
Faisal Akhter Avatar asked Jul 14 '13 12:07

Faisal Akhter


People also ask

How do I redirect observer in Magento 2?

In above execute() function, When you need redirect to specific URL, You need to pass your custom URL instead of customer/account/login as the second parameter in redirect() function.


3 Answers

This occurs when the base link urls are not changed in the table core_config_data (records with the following path column).

web/secure/base_url
web/secure/base_link_url
web/unsecure/base_url
web/unsecure/base_link_url

You must clear the cache after changing them. This also occurs if the var/cache folder is not writable and the cache is written in the OS default tmp folder.

like image 136
Marius Avatar answered Oct 22 '22 06:10

Marius


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.

like image 23
Vasily L Avatar answered Oct 22 '22 06:10

Vasily L


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.

like image 6
Jakub Korupczyński Avatar answered Oct 22 '22 04:10

Jakub Korupczyński