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 :
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';
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
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;