You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在本地搭建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.

Step 1: Add IIS Binding for www.store2.local

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 (or https if you're using SSL, but HTTP is fine for local testing)
    • Set IP address to All Unassigned or 127.0.0.1
    • Set Port to 80 (default for HTTP)
    • In the Host name field, enter www.store2.local exactly as it appears in your hosts file
  • Click OK to save the binding
Step 2: Configure the Second Store in NopCommerce Admin

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
Step 3: Test the New 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
Adding More Custom URLs Later

For any additional stores, just repeat the same process:

  1. Add the domain-to-127.0.0.1 mapping in your hosts file
  2. Add a new IIS binding for that domain to your existing Nop.Web site
  3. Create a new store entry in NopCommerce admin with the matching URL

内容的提问来源于stack exchange,提问作者Gaurav Radadiya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 04:06:19