I have a dev site and a production site on the same VPS but on different cpanels.

The dev is a not a sub domain, but a resolved domain.

They both have different databases.

The production site is fine.

The frontend of the dev site is fine.

When I go to log into the admin of the dev, it redirects to the base url of the production site, and of course throws an error.

The structure should be https://domain-staging.com/new_admin_login

but it redirects to https://domain.com/mew_admin_login

I have done the following:

  1. edited the env file correctly with new DB & new admin URL
  2. updated the information in the core_config_data (base url for secure and unsecure)
  3. Upgraded, compiled, deployed
  4. Flushed, cleaned and reindexed

The sites are both on Magento 2.1.6 on a cloud VPS running Centos 7.4 and PHP 7.0.


I believe you only experience this issue for either dev or prod site. It happens mostly by Cookie issues when you work on multiple sites with almost identical settings. The other issue for this problem maybe configuration set in admin for base url, but for the frontend works fine now, I bet it's related to Cookie.

Solution : Purge all the cookies for both sites.

  • How do I purge cookies from the site? Are you talking about the actual Magento cookies or the browser cookies? I have tried on several browsers already and still no go. – user3024161 Mar 15 '18 at 14:36

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.