cancel
Showing results for 
Search instead for 
Did you mean: 

Magento admin area redirects to the old url

Highlighted

Magento admin area redirects to the old url

magento 2.3.1 installed on lightsail using the official bitnami aws installer, if you go to the admin, it redirects back to the old website. In the database core_config_data the urls are correct.

I updated the domain name, I updated letsencrypt, I cleared and flushed magento cache and restarted everything. Only the admin area is redirecting

6 REPLIES 6
Highlighted

Re: Magento admin area redirects to the old url

Hello @rabingomes_rabi ,


Please confirm the data, you can update in core_config_data.

 

UPDATE core_config_data SET value = REPLACE (value,'https://olddomain.com/','http://www.yournewdomain.co/');

Then run the below commands :

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex
php bin/magento cache:flush
php bin/magento setup:static-content:deploy -f
chmod -R 777 var/ pub/ generated/

 

If my answer is useful, please Accept as Solution & give Kudos
Highlighted

Re: Magento admin area redirects to the old url

Hi @Binod Yadav 

 

You can also try one thing.

 

Go to app/etc/env.php and change the url for admin.

 

Then flush the cache and check it again.

 

Thanks!

Highlighted

Re: Magento admin area redirects to the old url

Hello @rabingomes_rabi 

 

1. Check env.php you are using new database details configured here.

2. Check core_config_data, some times there are 2 (4 rows) places where you need to change the urls. 

3. Try changing the admin url from env.php as @Rahul Gupta suggested

4. Make sure you have run all the commands as mentioned as @Binod Yadav suggested.

5. Check incognito or private browser.

 

Found something useful, "Kudos" and "Accept as Solution" for Token of Appreciation.

Magento Tutorials
Highlighted

Re: Magento admin area redirects to the old url

Didn't work for me 

Highlighted

Re: Magento admin area redirects to the old url

Please follow the below to resolve this

 

1. Check your database details
2. check core_config_data the base_url is new.
3. run below commands.
    php bin/magento maintenance:enable
    php bin/magento deploy:mode:set developer
    php bin/magento setup:upgrade
    php bin/magento setup:static-content:deploy -f
    php bin/magento setup:di:compile
    php bin/magento indexer:reindex
    php bin/magento cache:flush
    php bin/magento maintenance:disable

 

Let me know if any issues


If my answer is useful, please Accept as Solution & give Kudos

Highlighted

Re: Magento admin area redirects to the old url

@kishore_narang Have you tried in private window?