Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...DNN HostHeader ConfigurationDNN HostHeader Configuration
Previous
 
Next
New Post
3/24/2007 3:45 AM
 

First off, I'm new to the forum, however I have been using DNN for a while now and I am an ASP.NET developer. I have not gotten too deep into the coding behind DNN, but I have a fair understanding.

I have installed DNN into a virtual directory: http://www.mydomain.com/myvirtual 

I have configured the following entry in my web.config: <add key="HostHeader" value="/myvirtual" /> in order to have DNN filter out the /myvirtual application and make the site function as if it were hosted at the root level.

Now for my issues:

First - The install configured my default alias as: www.mydomain.com/install. I manually changed this in the SQL table and the site started and works fine. The issue I'm reporting here is the default install does not account for the "HostHeader" configuration properly.

Second - The default subhost.aspx does not account for the "HostHeader" configuration either. I have updated as follows:

<%@ Page Language="VB" %>
<%@ Import Namespace="DotNetNuke" %>
<script runat="server">
  Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    Dim DomainName As String
    Dim ServerPath As String
    Dim ServerPathURL() As String
    Dim URL() As String
    Dim intURL As Integer
    Dim HostHeader As String
    ' parse the Request URL into a Domain Name token 
    URL = Split(Request.Url.ToString(), "/")
    ' get the host header setting from web.config
    HostHeader = Right(Config.GetSetting("HostHeader").ToLower, Len(Config.GetSetting("HostHeader")) - 1)
    For intURL = 2 To URL.GetUpperBound(0)
      Select Case URL(intURL).ToLower
        Case "admin", "desktopmodules", "mobilemodules", "premiummodules"
          Exit For
        Case HostHeader
          ' filter the host header by skipping to the next
        Case Else
          ' check if filename
          If InStr(1, URL(intURL), ".aspx") = 0 Then
            DomainName = DomainName & IIf(DomainName <> "", "/", "") & URL(intURL)
          Else
            Exit For
          End If
      End Select
    Next intURL
    ' format the Request.ApplicationPath
    ServerPathURL = Split(Request.ApplicationPath, "/")
    For intURL = 0 To ServerPathURL.GetUpperBound(0)
      Select Case ServerPathURL(intURL).ToLower
        Case HostHeader
          ' filter the host header by skipping to the next
        Case Else
          ServerPath = ServerPath & IIf(ServerPath <> "", "/", "") & ServerPathURL(intURL)
      End Select
    Next intURL
   
    If Len(ServerPath) > 0 Then
      If Mid(ServerPath, Len(ServerPath), 1) <> "/" Then
        ServerPath = ServerPath & "/"
      End If
    Else
      ServerPath = "/"
    End If
    DomainName = ServerPath & "Default.aspx?alias=" & DomainName
    Response.Redirect(DomainName, True)
  End Sub
</script>

Now the child portal redirection functions properly. However, I am experiencing some anomalies and would like to know if this is to be expected or if there are plans to change the functionality.

Lets say I have a child portal with the alias of: www.mydomain.com/childportal, when the redirect occurs, the new URL is: http://www.mydomain.com/default.aspx?alias=www.mydomain.com/childportal and the portal site comes up. Now if you click on the "Home" breadcrumb you are then redirected to the following URL: http://www.mydomain.com/childportal/Home/tabid/<portalhometabid>/Default.aspx, which is actually what I would like to happen directly from the subhost.aspx, but I am not sure if that is possible or not. Now, if you click on the "Home" breadcrumb again you are redirected to yet another URL: http://www.mydomain.com/myvirtual/Home/tabid/<portalhometabid>/Default.aspx. And from now on you stay on the /myvirtual/ directory structure. Why does this happen? And how can I keep everything under the /childportal/ directory structure?

My apologies for posting such a long and complicated first post, but the anomalies are very much dependent on the steps as I have indicated.

 

 
New Post
3/28/2007 3:01 PM
 

Okay, I solved one of my issues: the subhost.aspx redirect. I have changed it as follows:

  Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

    Dim UCB As New DotNetNuke.Framework.UserControlBase
    Dim TabInfo As DotNetNuke.Entities.Tabs.TabInfo
    TabInfo = UCB.PortalSettings.DesktopTabs.Item(0)
    Response.Redirect(TabInfo.FullUrl, True)

  End Sub

 

Incidently, when I run this in Dev on XP IIS, "TabInfo.FullUrl" shows: http://localhost/childportal/Home/tabid/<portalhometabid>/Default.aspx

I have not been able to track down why it is still inserting the /myvirtual/ in the URL though. Does anyone have an idea as to why the "HostHeader" entry is not being honored?

 

 


However, the "TabInfo.FullUrl" shows: /myvirtual/Home/tabid/<portalhometabid>/Default.aspx instead of /childportal/Home/tabid/<portalhometabid>/Default.aspx.
 
New Post
3/28/2007 3:25 PM
 

Just curiosity, how is your HTTPAlias defined in the PortalAlias table???

Carlos

 

 
New Post
3/28/2007 3:27 PM
 
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...DNN HostHeader ConfigurationDNN HostHeader Configuration


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out