/*
Author: Jiangong SUN
*/
Today I have encountered a problem, I spent 3 hours and a half for figuring it out. I need to make the application compatible with muiltiple domain urls.
What i need is simply "cn".
//Detect country by subdomain and get first culture in Front (ex : cn.xx.xxx.xxxx.com ) //Add possibility of detect the culture in Contrib Front ( ex : web-cn.xx.xxx.xxxx.com ) if (Request.Url.Host.IndexOf('.') == 2 || Request.Url.Host.IndexOf('.') == 6) { string s = Request.Url.Host.Split('.')[0]; //Log.Error("host first part : " + s + "\n"); string l = s.Substring(s.Length - 2); //Log.Error("host culture : " + l + "\n"); Culture cult = GetCulture(l).FirstOrDefault(); }
<IIsWebVirtualDir Location ="/LM/W3SVC/98004751/root" AccessFlags="AccessRead | AccessWrite | AccessScript" AppFriendlyName="AP Contrib" AppIsolated="2" AppPoolId="AP" AppRoot="/LM/W3SVC/98004751/Root" AuthFlags="AuthAnonymous | AuthNTLM" DefaultDoc="Default.aspx,Default.htm,Default.asp,index.htm" DirBrowseFlags="EnableDirBrowsing | DirBrowseShowDate | DirBrowseShowTime | DirBrowseShowSize | DirBrowseShowExtension | DirBrowseShowLongDate | EnableDefaultDoc" MimeMap=".woff,application/x-woff" Path="G:\CONTRIB" ScriptMaps=""> </IIsWebVirtualDir>