Using HREFExchanger and Google SiteMap components for DotNetNuke on a multi-portal site

DotNetNuke (DNN) is an open-source portal system for ASP.NET. It is pretty good, but out-of-the-box it is not the most search engine optimised (SEO) software that there is. Two components that can help are HREFExchanger ($29.95) and
Google SiteMap

HREFExchanger rewrites the URLs of a site as friendly URLs, such that:


This is much nicer for the search engines, and will help your new visitors find you.

The Google SiteMap component generates an XML file called a … you guessed it … Google Sitemap. This file tells Google where all of your pages are and helps ensure that your site is fully crawled. I have noticed a big difference since adding sitemaps to my sites. The L-Space Sitemap component is the most expensive for DNN, and also the best. It is the only one that works properly with HREFExchanger, and the support is fantastic. It is worth the extra money.

I have happily combined these two components on a few DotNetNuke sites, but today I ran across two snags. I was adding HREFExchanger and Google SiteMap to an existing site with multiple portals and it was not working. The SiteMaps came out with only two pages listed and with non-friendly URLs. Using the site as such, the URLs were correct, but not in the SiteMap.

The first problem was due to a false assumption I had made. I assumed that Portal4’s SiteMap would be at http://portal4/GoogleMap.aspx and that Portal5’s would be at http://portal5/GoogleMap.aspx. This turns out not to be the case. The true URL for the sitemap is http://portal4/GoogleMap.aspx?portalID=4. Using this URL solved the first problem, now all of the pages on the portal were listed in the SiteMap. But they did not have friendly URLs.

According to the HREFExchanger site, in a multi-portal site with Google SiteMap, you need to make the following (example) additions to your web.config file:

<hrefExchanger extension=".aspx" w3c-output="transitional">
    <portal portalid="1" extension=".page" w3c-output="none">
        <url path="GoogleMap.aspx" action="filter" />
        <urlpath="images/SomeImage.aspx?getimage=1" action="ignore" />
    <portal portalid="2" extension=".dnn" w3c-output="strict" />

this is not correct. In a multi-portal site, the line <url path="GoogleMap.aspx" action="filter" /> should actually read <url path="GoogleMap.aspx?portalID=1" action="filter" />. Once I discovered this and made the changes, it all worked perfectly.

Hopefully the developers of these components will render this post obsolete in future versions of their products, but for now you need to make these changes.