I'm currently working a Magento 2 (2.1.14 exactly) mutli-store website and I have some problems for create a development website. I'm the only back-end developer in the company and had never work on Magento 2 before so I'm learning little by little how does it works.

We need to upgrade the Magento version, some plugins and add some functionnalities but I really need to have a clean development setup to work in, without the fear to break the production website.

Problem ⚠️

Current mode : developer

I followed these steps below but the dev website (dev.mywebsite.ch) still redirect me on the production server (www.mywebsite.ch).

  1. Create folder on server dev.website.ch
  2. Create a sub-domain and point to the newly created folder
  3. Copy all files and folders in it with rsync -avz source/* dest/
  4. Create a database dump filedump.sql
  5. Clean the dump file (advice from MgtCommerce) like sed "s/\/\*[^\/]*DEFINER.*\*\///" dump.sql > clean_dump.sql
  6. Import the dump file in the suitable DB
  7. Change the database detail in app/etc/env.php
  8. Change base URL and base secure URL in core_config_data table in the dev database

I also executed all commands I use when I want to upload a new thing/bug fix (SSH) :

  • chmod 775 /home/cloudpanel/htdocs/*/ -R
  • php bin/magento setup:di:compile
  • php bin/magento setup:static-content:deploy en_US fr_FR de_DE
  • php bin/magento cache:flush
  • php bin/magento cache:clean

Questions I used...


2 Answers 2



Try running the below commands

rm -rf var/cache var/view_preprocessed var/page_cache generated/* pub/static/frontend
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

This should solve your problem


If SSL isn't enabled on your development domain, make sure to use http:// in all core_config_data table entries (and not https://)

  • I tried this and the Anas solution above but it still redirect me to one of the store view (multi-store). I also tried to find the design/head/includes path in the core_config_data table described in this article but the value doesn't look the same : <meta name="p:domain_verify" content="ce45202ccd87ab3dabad07b683d27e79"/>
    – Benjamin
    Commented Jul 10, 2019 at 11:46
  • Can you please check your network tab to check how the redirect works? Also please search for the redirecting domain name in core_config_data Commented Jul 10, 2019 at 11:55
  • Here is the result @rajmohanr (301 error) : listing & detail
    – Benjamin
    Commented Jul 10, 2019 at 12:02
  • Can you please clear your browser cache and try now. I think so the page is working fine for me without redirection Commented Jul 10, 2019 at 12:23
  • 1
    Yes! I found the solution : I was right but we haven't a SSL for the development domain so I changed https://dev.riseup.ch/ for http://dev.riseup.ch/ in the core_config_data table
    – Benjamin
    Commented Jul 10, 2019 at 15:21

the redirect problem was due to magento cache.

try to deleted everything from var/ folder for your magento site(dev.website.ch). after that you cleared your browser's cache/cookies or try with private browser for good measure & it worked!

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.