This project is read-only.

Multiple MWPSK instances with one IP

Topics: Developer Forum, Project Management Forum
Apr 28, 2008 at 2:05 PM
How does one run multiple MWPSK instances in various subdirectories to run in a shared hosting environment with one IP?

All the AppData files want to run out of the root directory. I have created an index.aspx in the root to point to the subdirectories, and edited a lot of files to point to ~/Site1/..., but to no avail. I want each of the instances to be completely separate from one another.

I think the MWPSK is great, but I need more than one! And I bet if you allow this, MWPSK would be widely used!

Thanks in advance
May 15, 2008 at 4:20 AM
I also have this problem too and are trying to find a good solution, if anybody know or have ideas of how to fix this please let me know.
For more details I will describe the problem as follows:

In the shared hosting environment, we have one domain as the root domain, for example we have root domain, this domain point to the root directory.
When we want to create a new website with new domain ( we organize like this:
so when we browse the, we still get the default page or homepage but all the internal links now are:
we also can browse this page like this:
it returns the same page content.

I think the problem is the URL rewriting mechanism and the way mwpsk generate internal links. once again please discuss this situation to find the best solution and make the mwpsk better  and usable in shared hosting environment

May 15, 2008 at 10:20 PM
Edited May 15, 2008 at 10:20 PM
Ya, well, remember that ASP.Net reads the App_Folders from the main postion of the site. (~/ )
So, if you want multiple instances you must work in the App_Code code I think.

May 20, 2008 at 7:54 AM
I found a solution, I changed the way mwpsk generate links like this:
I put the shared folders in web.config file
and change a little bit in sitemapeditor class to store the full path of url instead of ~/
and it works without any problem.

Mar 14, 2010 at 2:13 PM

hallo Webburu,


i am looking for multiple site on one MWPSK instances. could you give me the file to:



Mar 19, 2010 at 3:32 PM

Yes, i found solution:

Add code to class "CustomXmlSitemapProvider.cs" as following


private const string _cProviderName = "CustomXmlSitemapProvider";       
        public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
            // Initialize the abstract base class.
            name = _cProviderName;
            if (String.IsNullOrEmpty(config["siteMapFile"]))
                config.Add("siteMapFile", "~/App_Data/" + System.Web.HttpContext.Current.Request.Url.Host.ToString()+"/Web.sitemap");
            base.Initialize(name, config);


change the following code from webconfig

<add name="CustomXmlSitemapProvider" type="MyWebPagesStarterKit.Providers.CustomXmlSitemapProvider" securityTrimmingEnabled="true"  />


add "HttpContext.Current.Server.MapPath("~/App_Data/" + System.Web.HttpContext.Current.Request.Url.Host.ToString());" to all class

HttpContext.Current.Server.MapPath("~/App_Data/" + System.Web.HttpContext.Current.Request.Url.Host.ToString());


you set defferent domains on iis:

upload the folder with same domain name to folder




try it!


Mar 22, 2010 at 10:55 AM

wow - this seems to be exactly what I need!

with one limitation:

- I normaly use domains with and wothoit the www-Hostname.

And sometimes I use a dummydomain for devleoping n new web, like


I think it would be a goodidea to habe a function that translates hostnames to IDs, where i can define a list of hostnames used for one instance, and then

instead of: config.Add("siteMapFile", "~/App_Data/" + System.Web.HttpContext.Current.Request.Url.Host.ToString()+"/Web.sitemap");

use config.Add("siteMapFile", "~/App_Data/" + GetwebID(System.Web.HttpContext.Current.Request.Url.Host.ToString()).Tostring() +"/Web.sitemap");

I'l try it tomorrow and if it works I will post it!