Recently I have been fielding a number of questions regarding DotNetNuke development environments and the valid URLs associated with them. People that have been setting up local instances of DotNetNuke for testing or development, then trying to expose the site to a larger group for validation. The process to make this work is very simple, however, for individuals unfamiliar with DotNetNuke settings it can be a bit difficult to determine exactly what needs to change. This post investigates the DotNetNuke concept of Portal Aliases and will show an individual how they can be used to solve this specific business need.
Overview
Most people that start out with DotNetNuke fully realize that DotNetNuke supports the ability to create multiple portals within a single installation. So you can host mysite.com and mysecondsite.com from the same DotNetNuke installation without any problem. This is completed by adding a new portal to the system, and you specify the new url as the Portal Alias. This Portal Alias value is what DotNetNuke uses to associate an incoming URL to that of the sites content to display. Therefore if no matching alias is found, DotNetNuke will default to the first one.
Why is this a Problem?
This can be a problem for individuals looking to test the site locally as in most cases you have 3 possible ways to access a DotNetNuke site hosted locally.
- http://localhost/dnn/
- http://<yourip>/dnn/
- http://<computername>/dnn
In this example might reflect something like 192.168.1.1 and would reflect the name of your computer. When DotNetNuke is usually installed most people use the http://localhost/ formatted URL to trigger the installation, behind the scenes this adds an alias for the localhost address.
This works perfect for testing on the local machine, however, when visitors try to access the site via a different channel they will be redirected to the localhost instance, which is no longer valid. This is where the portal alias comes into play. A secondary alias is needed to actually allow the site to respond to the other addresses.
How Do I Add a Portal Alias?
Now that we know we need a new alias, the process to add it is very simple. Log in as the Host user to your DotNetNuke site, then from the "Admin" menu select "Site Settings". If you scroll to the very bottom of the page, you will find an "HTTP Aliases" section, click the "Add HTTP Alias" link. In here you can specify the other address that can be used for the site. Any added alias will simply provide the same content but will ensure that the URL doesn't default to another alias value.
Conclusion
Development environment setup questions are often very regular items that I see posted to DotNetNuke.com and my forums so I thought that this quick overview would help those just starting out. Portal aliases are very helpful items to work with, however, in a production system one must be careful that multiple domains do not serve the same content as search engines could flag the content as duplicated. As always please share your comments below, any requests for help to the forums.