0

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.

8
  • did you create an entry in your hosts file? I'm not talking about the webserver vhosts Feb 21, 2019 at 10:35
  • Yes I have added two entry in host file. 127.0.0.1 magento230.com and 127.0.0.1 wateroff-test.net
    – Hiren Shah
    Feb 21, 2019 at 11:21
  • webserver restarted? Feb 21, 2019 at 11:58
  • Yes restarted. @PhilippSander is there any other configuration required? I am new to Magento 2.
    – Hiren Shah
    Feb 21, 2019 at 12:07
  • have you fully read an understood the magento2 setup tutorial? Feb 21, 2019 at 12:23

1 Answer 1

0

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.

Your Answer

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

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