如何在本地搭建NopCommerce 4.0(.NET Core)多店铺?IIS部署场景求助
Got it, let's walk through getting your multi-store setup working smoothly—since you already have your hosts file configured and www.store1.local up and running, we just need to tie in www.store2.local and get NopCommerce to recognize it properly.
You don't need to create a separate IIS site for the second store—NopCommerce supports multiple stores sharing the same application pool and published folder. Here's how to add the binding:
- Open IIS Manager, locate your existing Nop.Web site (the one bound to www.store1.local)
- Right-click the site and select Edit Bindings
- Click the Add button in the Site Bindings window
- For the new binding:
- Set Type to
http(orhttpsif you're using SSL, but HTTP is fine for local testing) - Set IP address to
All Unassignedor127.0.0.1 - Set Port to
80(default for HTTP) - In the Host name field, enter
www.store2.localexactly as it appears in your hosts file
- Set Type to
- Click OK to save the binding
Now you need to tell NopCommerce about the new store. Log into your admin panel via http://www.store1.local/admin and follow these steps:
- Navigate to Configuration → Stores from the left menu
- Click the Add new button to create a store entry:
- Store name: Give it a descriptive name (e.g., "Store 2")
- Store URL: Enter
http://www.store2.local(make sure this matches the IIS binding exactly—no extra spaces, correct HTTP/HTTPS) - Secure URL: If you're using HTTPS, enter the secure version; otherwise, you can use the same value as Store URL or leave it blank for now
- Display order: Set this to
2(or any number to control how stores appear in admin dropdowns) - Optional: Configure other settings like store logo, default language, default currency, or contact info based on your needs
- Click Save to create the store
Open your browser and navigate to http://www.store2.local—you should see your second store load up. If it redirects to www.store1.local or throws an error, double-check these:
- Ensure the IIS binding for www.store2.local has the correct host name (no typos!)
- Verify the Store URL in NopCommerce admin matches the domain exactly (including HTTP/HTTPS)
- Clear your browser cache and cookies—sometimes old cached data can cause unexpected redirects
For any additional stores, just repeat the same process:
- Add the domain-to-127.0.0.1 mapping in your hosts file
- Add a new IIS binding for that domain to your existing Nop.Web site
- Create a new store entry in NopCommerce admin with the matching URL
内容的提问来源于stack exchange,提问作者Gaurav Radadiya

