Question

I have setup Magento 2 in WAMP stack.

I have created two virtual hosts.

  1. magento230.com
  2. wateroff-test.net

    # magento230.com
    <VirtualHost *:80>
       ServerName magento230.com
       ServerAlias www.magento230.com
       DocumentRoot "C:/wamp/www/magento230"
       <Directory "C:/wamp/www/magento230">
           Options +Indexes +Includes +FollowSymLinks +MultiViews
           AllowOverride All
           Require all granted
       </Directory>
    </VirtualHost>
    
    # wateroff-test.net
    <VirtualHost *:80>
       ServerName wateroff-test.net
       ServerAlias www.wateroff-test.net
       DocumentRoot "C:/wamp/www/magento230"
       SetEnv MAGE_RUN_CODE "wateroff_net"
       SetEnv MAGE_RUN_TYPE "website"
       <Directory "C:/wamp/www/magento230">
           Options +Indexes +Includes +FollowSymLinks +MultiViews
           AllowOverride All
           Require all granted
       </Directory>
    </VirtualHost>
    

Now created two websites in Magento admin.

  1. default website
  2. wateroff website

Wateroff website configuration in admin.

  1. Website name - Water Off (wateroff.net)

    Website code - wateroff_net

    Default store - Wateroff store

  2. Store Information

    Store name - Water Off Store

    Store code - water_off_store

    Root Category - Water off

    Default Store View - US-English(WF)

  3. Store View Information

    Name - US-English(WF)

    Code - wateroff_us

    Status - enabled

When I run url http://magento230.com/ its working fine and http://magento230.com/customer/account/create/ working fine.

BUT

When I run url http://wateroff-test.net/ its not working fine and http://wateroff-test.net/customer/account/create/ gives error like This site can’t be reached.

When i see issue in console it gives me same error for all css and js.

      Failed to load resource: net::ERR_NAME_NOT_RESOLVED

I already run below command in same manner.

      php bin/magento cache:flush 
      php bin/magento setup:upgrade
      php -dmemory_limit=5G bin/magento setup:static-content:deploy -f

What is the issue here I don't know.

Please help me.

Was it helpful?

Solution

We have resolved above issue. I went through details and found that in admin I have configure wrong url.

My host file like. 127.0.0.1 wateroff-test.net

But in admin configuration I have added www before domain.

Base url http://www.wateroff-test.net Base link url http://www.wateroff-test.net

So removed www and put only http://wateroff-test.net url and working fine.

Thank you everyone to give support.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top