We've just finished our new website; it's no secret that we're running DotNetNuke (DNN) - an awesome feature rich, open source web application framework. After launching the site, the next step was to get it indexed by major search engines. The best way to do that is to start by creating a Google Sitemap. I was pleased to find out that the latest version of DotNetNuke came with standard install /Sitemap.aspx file which rendered an XML Google Sitemap. This was great, but it fell short - it didn't map the abundance of content we store in the Blog module.
Here's how we got a richer Google Sitemap running, which mapped all pages including all blog/article entries.
If you’re running DotNetNuke 4.5.1 or later, you’ll notice a Sitemap.aspx file in the root directory. Navigate to that in your web browsers, and you’ll be served up an XML Google Sitemap. This lists all pages in your portal, obeying permissions – only showing pages with anonymous access allowed.
This is a great start, but closer inspection of the sitemap.aspx XML told me that although DNN had indexed our Blog and Articles page, it had only done it for the default view of the page.
Take a look: http://www.netpotential.co.nz/sitemap.aspx
Our Articles, Announcements, and Blogs all use the Blog module to store and serve content. We decided it was by far the best choice of module to suit our requirements. The Blog module sits within one page (well strictly speaking you could add it to a number of pages), and creates and serves its own subset of pages. Over time we expect there will be hundreds of pages within this area of our site, so we needed to make sure the content is being exposed to search engines as effectively as possible.
We needed to do something else in order for the content in the Blog module to get listed in an XML Sitemap. A quick Google search brought up hundreds of results, but the one that caught my eye was this article on CodeProject.com:
It explains how to use a Provider based model to generate a Google Sitemap from custom modules – something I’m sure many DNN developers would agree is a damn useful bit of code!
All I had to do was throw the assembly DLLs in the bin, add a few lines of code to web.config, and we had an XML Google Sitemap complete with all our Articles, Announcements, and my Blog posts listed. It couldn’t have been easier, and best of all Bruce has given us this for free!
Take a look now: http://www.netpotential.co.nz/googlesitemap.axd
Cheers Bruce!
Tim Thomas - Technical Director,
NetPotential
Mob 021 535 832