Magento is automatically redirecting to localhost on live server

后端 未结 7 2623
一生所求
一生所求 2021-02-15 18:12

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

相关标签:
7条回答
  • 2021-02-15 18:35

    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.

    0 讨论(0)
  • 2021-02-15 18:41

    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.

    0 讨论(0)
  • 2021-02-15 18:42

    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.

    0 讨论(0)
  • 2021-02-15 18:44

    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;
    
    0 讨论(0)
  • 2021-02-15 18:45

    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.

    0 讨论(0)
  • 2021-02-15 18:49

    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'
    
    0 讨论(0)
提交回复
热议问题