One of the issues in installing DNN at GoDaddy is that you must put the installation in a subdirectory of the host root or ASP.net does not get the required permissions. This leads to the question of how it is best to redirect. GoDaddy suggest a meta tag refresh. Previously in this forum I discussed the use of a default.aspx file in the host root using response.redirect (I still think server.transfer would be the better method but can't get it to work). Here I would like to discuss the behavior of DNN when using a meta tag refresh with multiple portals.
Suppose I have one host space/domain name and three portals under DNN - wholesale.x.com and retail.x.com and www.x.com. I configure DNS and the host at GoDaddy for the portals. (I used parent portals instead of child portals so the browser would display a more "friendly" url to the user.) If as GoDaddy suggests - I then use a meta tag refresh I get the following behavior.
If I type www.x.com it triggers the redirection and the url in the browser displays www.x.com/portal.
If I type wholesale.x.com or retail.x.com it triggers the redirection and the url in the browser displays www.x.com/portal (the wrong portal).
If I type wholesale.x.com/portal it triggers the redirection and the url in the browser displays wholesale.x.com/portal (the correct portal).
If I type retail.x.com/portal it triggers the redirection and the url in the browser displays retail.x.com/portal (the correct portal).
This behavior does not occur when using response.redirect (typing wholesale.x.com, retail.x.com or www.x.com takes you to the correct portal). I posted the complete code for a default.aspx previously (don't leave any other files in the host root except maybe a web.config for debugging). One other thing, a 301 response.redirect is SEARCH ENGINE FRIENDLY. One of the bigger problems meta tag refresh has is that it is a common spam technique. Some people suggest setting the meta refresh to at least 5 seconds to avoid any ranking penalty, but with meta tag refresh Google will still show the URL of the original page in the search results if it has a higher PageRank than the location of the destination page. A 301 redirect is a permanent change of location code. It tells a search engine spider that a page or website has permanently moved and to record the new location.
<script runat="server">
Sub Page_Load(ByVal Source As Object, ByVal E As EventArgs)
If Not IsPostBack Then
Response.Status = "301 Moved Permanently"
Response.Redirect("~/portal/default.aspx", True)
End If
End Sub
</script>