I have a site map configured as such:

<siteMap xmlns="" >
<siteMapNode url="" title="Site Name"  description="">

    <siteMapNode url="home.aspx" title="My Home"  description="My Home" Group="Active">

        <siteMapNode url="Search.aspx" title="Search"  description="Search For Roommate" Group="Active">
            <siteMapNode url="SearchResults.aspx" title="Search Results"  description="Roommate Search Results" Group="Active"/>

        <siteMapNode url="Extend.aspx" title="Extend Account"  description="Extend Account" Group="Active"/>

        <siteMapNode url="Hotlist.aspx" title="Hotlist"  description="Hotlist" Group="Active"/>

I have a custom breadcrumb function that looks like this:

Public Shared Function SitePath(ByVal tr As String, Optional ByVal type As String = "REG") As String
    If SiteMap.Providers(type).CurrentNode IsNot Nothing And SiteMap.Providers(type).CurrentNode IsNot SiteMap.Providers(type).RootNode Then
        Dim currentNode As SiteMapNode
        currentNode = SiteMap.Providers(type).CurrentNode
        Dim path As String = currentNode.Title
        Dim str As String = ""

            currentNode = currentNode.ParentNode
            path = "<a href=""" & shsutils.generateURLSecure(currentNode.Url, tr & str) & """>" & currentNode.Title & "</a>" & "&nbsp;&gt;&nbsp;" & path
        Loop While currentNode IsNot SiteMap.Providers(type).RootNode

        SitePath = path
        Exit Function
    End If
    SitePath = ""
End Function

For some reason, even though in the sitemap, the url is defined as "" or "home.aspx", the currentNode.URL always has the domain attached to the URL, creating bad urls like ""

I've tried to figure out where was coming from by search my project and inside of my web.config file, but I can't seem to find it.

Any ideas or suggestions?


I found the reason why.

The domain was configured inside of the web.config file, under

    <add key="domain" value="" />

The subdirectory was due to the fact that the application was hosted inside of a virtual directory. The combination of the two is how the sitenode created the urls.