IIS configuration with support of multiple domain urls
来源:互联网 发布:局域网文件加密软件 编辑:程序博客网 时间:2024/06/12 23:53
/*
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.
I need to get the country information when parsing the two urls: cn.xx.xxx.xxxx.com and web-cn.xx.xxx.xxxx.com
What i need is simply "cn".
Here is my code :
//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();}
I have two test cases in my recette envrionment, on called Contrib, the other call Front. They hold the same codes and same configurations. But in fact it works in one case and not the other one.
With confusions and frastration during 3 hours, I've found that it's because there is a tiny difference between their configurations in IIS 6.
It's just the parameter "DefaultDoc". My application's default page is "Default.aspx". It won't work if i don't indicate it in my IIS configuration. The case not working doesn't have this parameter.
<IIsWebVirtualDirLocation ="/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>
AT LAST, it work for me. Enjoy coding!!!
- IIS configuration with support of multiple domain urls
- Separating out WCF Configuration Into Multiple Files with configSource
- Managing Multiple Configuration File Environments with Pre-Build Events
- Load multiple configuration files from different directories with Spring Boot
- Call multiple URLs on single click of af:goLink in Oracle ADF
- Spring JDBC Support with jdbc configuration in code directly
- Sysbench with support of multi-tables workload
- WCF interactive with IIS 7 Support for non-http portocals
- Running Multiple Version of .Net Framework in IIS 6.0
- Web service failed to start because of wrong IIS configuration
- Parsing URLs with the DOM
- Parsing URLs with the DOM
- Parsing URLs with the DOM!
- Multiple Block Size Support
- Multiple APK Support
- Scala Multiple Installation Support
- Android Multiple APK Support
- Autoresize of columns in MSHFlexGrid with multiple bands
- Virtual Twin Turing Machine: Bilingual Information Processing as an Example
- ubuntu设置ip和dns
- C++11
- The Uniqueness of Software Engineering: The Dual Formalizations
- #pragma 预处理指令详解
- IIS configuration with support of multiple domain urls
- Linux下命令行截图工具scrot
- 需求中的use case senarios
- this super
- 计算机科学家(麦肯锡)敲定“人工智能”这个术语
- Lvalues and Rvalues
- 计算机变革史及背后技术原因
- 解决网站使用sqlite时并发问题的一个经验
- 程序员需要知道的12件事