URL Rewrite city.domain.com to domain.com/city

Posted by: Scott Forsyths WebLog, on 23 Nov 2011 | View original | Bookmarked: 0 time(s)

An IIS 7.x URL Rewrite question that comes up often is how to redirect something.domain.com to domain.com/city. Heres an example URL Rewrite rule to accomplish that: <rule name="CName to URL" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_HOST}" pattern="^(?!www)(.*)\.domain\.com$" /> </conditions> <action type="Redirect"...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: IIS | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 288 | Hits: 21

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD