Hosting Multiple Sites Based on Host Names

To host multiple sites using 1 web installation you need a dedicated ip address so you can point multiple host name DNS records at the ip address of your site, and your site should be configured to handle all requests for that ip address. In IIS, it is possible to host multiple mojoPortal sites using a shared ip address, but this requires adding host headers in IIS for each site that will be handled by mojoPortal.


1. Get the first site working first
2. Make sure the web.config setting AllowMultipleSites is set to true (in the first site.
3. Go to Admin > Site Settings in the first site. You should see a dropdown list next to the site name, choose "New Site", then enter a name for the new site and click Save



After you save the new site, some new settings appear at the bottom of the page for configuring the new site.


3 Enter the host name for the new site and click the Add Host button. You may also configure which features are installed in the new site.

If using multiple physical web sites, configure the second physical web site with the same connection string as the first site. The host name you entered for the new site must point to the new site through DNS. mojoPortal uses the host name to determine the siteid from the database, if no host name is configured, the content will be the same in both sites as it will always default to the first site when there is an unknown host name.

The first site is the master site as it can control what features are installed in the child sites. If using multiple physical web installations and one db, it is probably best if only the first site has the web.config setting "AllowMultipleSites" set to true.

Open another browser and navigate to the other host name.

I have a additional information in a tutorial here on hosting multiple sites with Apache Virtual Hosts and mod_mono


Donate Money to support the mojoPortal Project.
Join the mojoPortal Group on Facebook
Join the mojoPortal Group on LinkedIn
View Joe Audette's profile on LinkedIn
View Joe Audette's profile on The Guild of Accessible Web Designers site
mojoPortal can run on GNU/Linux using Mono

ASP.NET Web Applications, Controls, Resources, Reviews
WorldOfASP.NET
view our resources 123aspx.com Directory
411ASP.NET
mojoPortal Wins the 2007 Open Source CMS Awards Best Non-PHP Open Source CMS
Share This Using Popular Bookmarking Services