Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Multi Site and LocalHost (Visual Studio debug mode using IIS Express)

Vote:
 

When I create a multi site locally while running my Visual Studio EPi project in debug mode, I give the new site another port number in local host.  However, this page does not resolve when i navigate to it.

I even tried it from home using the default out of the box alloy sample site. Still no resolution.

Has anyone tried this and got it working using locahost?  If so, please let me know what you did to get the second site resolvable.

It seems like only the first site it launched ini IIS Express. 

#204468
Jun 03, 2019 20:20
Vote:
 

Hi Thanh,

I've been able to get this working with an Episerver Commerce Training solution.

Try the following;

  1. Edit your local hosts file (c:\windows), add your host and point them to 127.0.0.1. Eg.
    127.0.0.1 localhost
    127.0.0.1 sitea.com
    127.0.0.1 siteb.com

  2. Edit your Applicationhost.config file (\.vs\config\applicationhost.config) set the bindings for IIS Express. Eg.
    <bindings>
    <binding protocol="http" bindingInformation="*:80:localhost" />
    <binding protocol="http" bindingInformation="*:80:sitea.com" />
    <binding protocol="http" bindingInformation="*:80:siteb.com" />
    </bindings>

  3. In IIS (if you have local IIS installed) stop running any sites that are running on your local IP 127.0.0.1 on port 80.
  4. Run Visual Studio as Administrator
  5. In Visual Studio, right-click your Project open Properties, and set the Project Url, save it. Eg.


  6. In Visual Studio, run / debug the site, it should run on http://localhost
  7. Log into /Episerver and (I'm assuming you already have a Page to use as the Start page for each site) configure the Websites in CMS > Admin > Config > Manage Websites


    localhost


    sitea.com
#204478
Edited, Jun 04, 2019 5:16
Vote:
 

THank you! I will give this a try and let you all know if this works!

#204513
Jun 04, 2019 19:11
Vote:
 

Hi,

You can run multiple site using normal IIS hosting. Like-

1. Go to "C:\Windows\System32\drivers\etc\". Open the "hosts" file in edting mode and add all the sites that you want to host using below syntax -

      127.0.0.1 site1 site2 site3 

2.  Now login to episever and go to "Admin/Config/Manage Website" and add all the site that you want to run.

    

FYI - To run sites using IIS you need a developer license that you can get from here - https://license.episerver.com/

Regards

Ravindra

#204567
Jun 10, 2019 9:44
Vote:
 

Thank you everyone! This works perfectly.

I couldn't report back sooner because we had other issues with redirect/reply URLS (we are using SSO and passing in claims data) so I had to get that figured out as well.

#204841
Jun 19, 2019 20:05
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.