DotNetNuke Tips and Tricks #24: Local Virtual Hosts

Mar 11

Written by: Joe Brinkman
3/11/2011 1:59 AM  RssIcon

In my position as the release manager for DotNetNuke, I end up installing DotNetNuke numerous times every week.  While I have a set of PowerShell scripts which makes this process relatively painless there were still some areas that I felt needed improvement.  In the past I have created all of my sites as applications in a virtual directory under the default site in IIS 7.5 (Windows 7).  This usually results in some URL for my site that looks like this: http://localhost/myDNNsite.

While this works, it does limit me to one type of URL.  If I want to test DotNetNuke using a standard domain then I have to edit the Windows Host file to create a dummy domain record.  This works fine but adds one more resource that must be managed.  Phil Beadle, who works on the engineering team at DotNetNuke Corp., actually has his PowerShell script automatically create the Host entry, but I fundamentally would rather not have to deal with the Host file.

A few weeks ago, I stumbled across a blog post from Mathew Hutchinson which has since changed how I setup my sites.  There are at least 2 services that I have found that have public Domains registered to point to 127.0.0.1.  These domains, lvh.me and smackaho.st, allow me to setup my DotNetNuke sites using a URL like this: http://myDNNsite.lvh.me or http://myOtherSite.Smackaho.st .  I can then use Host Headers in IIS to ensure that these resolve to the appropriate website.  Now I have the best of both worlds, I can use an IIS site with host headers and a virtual subdomain or I can use the default site with a virtual directory.  I never have to touch my Host file and I can test out all of the different URL behaviors in DotNetNuke.

Sponsors Minimize
spacer
dummy