Multiple Domains mapping to your site

May 28, 2010 at 2:04 PM

Version 1.1 of WikiX does not support having multiple domains mapped to your site.  The syntax of the wiki will not be converted to links. Instead you will always see [[link]].

The reason for this is in the WikiRewrite.cs - where it tries to parse any of the wiki syntax, the code creates a PageReference from the complete url (domain included).  If it doesn't match the siteUrl in in the <site> settings in the web.config then the syntax will not be parsed. 

To "fix" this we need to convert the full path to a relative path:

Change line 48 : PageReference pr2 = PermanentLinkUtility.GetPageReference(((EPiServer.Web.UrlRewriteEventArgs.Context)e.Context).InternalUrl); 


//= convert the url from full to relative to handle the scenario where                
//=  the site url in the web.config is not the url requesting the wiki.                
UrlBuilder urlBuilder = ((EPiServer.Web.UrlRewriteEventArgs.Context)e.Context).InternalUrl;                
string relativeUrl = urlBuilder.ToString().Replace(string.Format("http://{0}", urlBuilder.Host), string.Empty);                
PageReference pr2 = PermanentLinkUtility.GetPageReference( new UrlBuilder(relativeUrl));