0

I'm using Magento 2

We have moved the site from one domain to another and also changed the folder location one IP address to another IP address.

After the change the admin panel is working fine but in then front-end, except for the home page, every page/link is redirecting to the old domain.

Categories and product links are also redirecting to the old domain

I have tried the following :

1)

update core_config_data set value = 'http://newdomain.com/' where path = 'web/unsecure/base_url'; 
update core_config_data set value = 'http://newdomain.com/' where path = 'web/secure/base_url';

2) Delete sudo rm -rf var/cache/*, var/page_cache var/view_preprocessed pub/static/ folder After deleting I have run following commands

php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
php bin/magento cache:flush
php bin/magento cache:clean

3)

     SET FOREIGN_KEY_CHECKS=0;
    UPDATE `store` SET store_id = 0 WHERE code='admin';
    UPDATE `store_group` SET group_id = 0 WHERE name='Default';
    UPDATE `store_website` SET website_id = 0 WHERE code='admin';
    UPDATE `customer_group` SET customer_group_id = 0 WHERE        customer_group_code='NOT LOGGED IN';
    SET FOREIGN_KEY_CHECKS=1;
  • Check the env.php , maybe you have the same name of database . – Ylgen Guxholli Oct 18 '18 at 17:58
  • Please check your .htaccess file from Magento Root Directory, if there is any code for redirection Please remove and check after flush cache. – Kishor Thummar Oct 19 '18 at 5:32
  • Try to restart apache. For some share hosting like godaddy try to switch php version and clear browser cache. – Jeremy L Bach Sep 4 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.