ASPNetFAQ.com: What is ASP.NET?

Technology posts on ASP.NET, IIS, Windows (+ a little Linux), Cloud Servers, Hosting, and more!
  • Blog Home
Search the site...

Using URL ReWrite to host multiple sites/domains under a single site

Tweet
Share
0 Shares

Scott Forsyth has a couple of good blog posts with pointers on using URL ReWrite to host multiple sites/domains under a single site:

http://weblogs.asp.net/owscott/archive/2010/01/26/iis-url-rewrite-hosting-multiple-domains-under-one-site.aspx
http://weblogs.asp.net/owscott/archive/2010/05/26/url-rewrite-multiple-domains-under-one-site-part-ii.aspx

More from my site

  • Resolving a “There is a duplicate ‘system.web.extensions/scripting/scriptResourceHandler’ section defined” ErrorResolving a “There is a duplicate ‘system.web.extensions/scripting/scriptResourceHandler’ section defined” Error
  • PUT/POST/DELETE Verb Errors On SitePUT/POST/DELETE Verb Errors On Site
  • Orchard: Custom Content in Sub-FoldersOrchard: Custom Content in Sub-Folders
  • Enable Caching in IIS to Speed PerformanceEnable Caching in IIS to Speed Performance
  • Log Parser: Pulling Valuable Data From IIS LogsLog Parser: Pulling Valuable Data From IIS Logs
Tweet
Share
0 Shares
cytanium, Development/Coding, Hosting, IIS, OrcsWeb, System Administration, Windows

One comment on “Using URL ReWrite to host multiple sites/domains under a single site”

  1. Brad Westness says:
    July 12, 2011 at 3:59 pm

    I set up all three of my alias domains with the following rule:

    <rule name="Alias Domains" patternSyntax="ECMAScript"
    stopProcessing="false">
    <match url="^([^?]*)" />
    <conditions logicalGrouping="MatchAll"
    trackAllCaptures="true">
    <add input="{HTTP_HOST}"
    pattern="killstone|raggedbay|musicalcollective" />
    <add input="{REQUEST_URI}"
    pattern="^killstone|^raggedbay|^musicalcollective"
    negate="true" />
    </conditions>
    <action type="Rewrite" url="{C:0}/{R:0}"
    appendQueryString="true" logRewrittenUrl="true" />
    </rule>

    Then, I added a second rule to handle "pretty permalinks" in my subdomain’s WordPress instances:

    <rule name="Alias WordPress" stopProcessing="true">
    <match url=".*" />
    <conditions logicalGrouping="MatchAll"
    trackAllCaptures="false">
    <add input="{HTTP_HOST}"
    pattern="killstone|raggedbay" />
    <add input="{REQUEST_FILENAME}" matchType="IsFile"
    negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory"
    negate="true" />
    </conditions>
    <action type="Rewrite" url="{C:0}/index.php"
    logRewrittenUrl="true" />
    </rule>

    The only caveat is that the pretty URLs rewrite only works on sub-folders if you use a trailing slash. So, in order to log into the WordPress dashboard, you need to go to /wp-admin/ (not just /wp-admin).

Proverbs 19:20

"Get all the advice and instruction you can, so you will be wise the rest of your life."

A Note On WordPress Hosting

Our main focus is of course .NET, but with a mix of Linux, virtualization, and other technologies. But if you're really looking for the best WordPress hosting specifically, read my WordPress host review to save yourself hassle AND money!




Recent Posts

  • What makes good web hosting?
  • jQuery Mobile C# ASP.NET and N5 Networks Software Repository
  • Open Source Bug Tracking Software and the Orchard Project
  • ASP.NET Development with Dreamweaver MX: Visual QuickPro Guide
  • Kendo UI Sample, ASP.NET Ajax Tutorial & More

Tags

ASP.NET Automation centos CMS css cytanium Development/Coding Email gmail Hosting htaccess http https IIS javascript Learning Linux logparser MySQL nginx openssl OrcsWeb performance PowerShell redirect RHEL security server SherWeb smtp SQL/Databases ssl System Administration telnet terminal tip Troubleshooting Ubuntu virtualization Visual Studio web farm web hosting Windows windows server Wordpress

Categories

  • ASP.net development
  • Development/Coding
  • Hosting
  • IIS (Internet Information Services)
  • SQL/Databases
  • System Administration
  • Virtualization
(c) ASPNETFAQ.com