I have created two websites like this.

enter image description here

Actually my website like this http://puppetkart.com/ enter image description here

When i opened my new website, I am getting website without CSS and Media files.

enter image description here

  • You want to add multiple domain to each website ? – Dhaval Solanki Aug 1 '18 at 5:53
  • yes ok i added multiple domain. after that I have following page – nukala satish Aug 1 '18 at 6:00
  • please see the updated question and following link:vizag.puppetkart.com – nukala satish Aug 1 '18 at 6:01
  1. Create a Websites and it's relevant Store and StoreView from Admin > Stores > All Stores
  2. Go to Stores > Configuration, Select website which you have created. Then Go to Web and change both Base URLs & Base URLs (Secure)

    For example : e.g. Base URL: puppetkart.com (Main website url keep as it is) Base Link URL: {{unsecure_base_url}}vizag/

    Here, ch is a sub directory folder which needs to create under your magento root folder

  3. Create a sub directory folder, then copy index.php & .htaccess from root

  4. Open index.php replace everything with the code bellow:

    require realpath(__DIR__) . '/../app/bootstrap.php';
    $params = $_SERVER;
    $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'vizag'; 
    $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website'; 
    $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
    $app = $bootstrap->createApplication('Magento\Framework\App\Http');

    vizag is a website code.

  • my base url is puppetkart.com – nukala satish Aug 1 '18 at 9:47
  • i want to implement different websites for different cites like vizag and hyderabad – nukala satish Aug 1 '18 at 9:48
  • @nukalasatish, Check once my updated answer – Teja Bhagavan Kollepara Aug 1 '18 at 9:58
  • ok i will check now – nukala satish Aug 1 '18 at 10:00

clear static contents by with below command:

rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/* var/session/* var/view_preprocessed/* pub/static/*

And do deploy static contents:

php bin/magento setup:static-content:deploy
  • is it run the entire command in putty"rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/* var/session/* var/view_preprocessed/* pub/static/*" – nukala satish Aug 1 '18 at 6:18
  • you can run entire or in parts like :rm -rf var/di/* , rm -rf var/generation/* , rm -rf var/cache/* – Feedlay Technologies Aug 1 '18 at 6:26
  • where to run them? in root or subdomain ? – nukala satish Aug 1 '18 at 6:27
  • see the above updated pic. The result shows like that in putty – nukala satish Aug 1 '18 at 6:33
  • Run this command in your terminal php bin/magento setup:static-content:deploy – Dhaval Solanki Aug 1 '18 at 8:16

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.