Actually I need 2 magento instances of same site. One is something like production site other is like dev site. I make all the changes in the dev site and show to client or some other.

I have set up main site.(http://example.com/magento) copied all the content and placced it in a new directory(http://example.com/magento2) also created a new database and imported the data from main site.

Changed database name env.php and changed store urls in core_config tbl in new database.

Now if I go to http://example.com/magento2, its working fine. But When I click the links or products it redirects to main site urls like http://example.com/magento/men.html instead of http://example.com/magento2/men.html

Even the admin login is redirected to main site url.

Any other changes are needed other than changing store url in db and db name in env.php?

1 Answer 1


That should be it other than clearing your cache and redeploying static content just to be sure you haven't bought over the old configurations cache.


bin/magento cache:flush

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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