As we commented on the last article, we are going to make the basic configuration issues on the element "SubgurimSiteMapConfiguration".
Let's see one by one all the configuration Items:
- dataPath
The directory path on which an XML file will be saved. The Subgurim SiteMaps will use it as a DataBase.
This directory SHOULD have write permissions. If it's left empty, the value will be "~/App_Data/SiteMap/"
- sitemapResponse
The final path of the visible SiteMap. Therefore it will be the value that we should indicate to the Google SiteMaps and Yahoo Explorer.
It it's left empty, the value will be "~/sitemap.aspx".
- forbiddenPaths
It's quite common that we don't want some paths to be filed on the SiteMap.
For example an entire folder of a private zone, or an specific file.
Foreach Path we want to hide, we should add a "<Path />" elemento (we will see it on the next example).
- acceptedExtensions
By default, the Subgurim SiteMaps only stores ".aspx" urls.
We should add an "<extension />" element, foreach extra extension we want to store.
For example, we could want to store url's with ".html" o ".htm" extensions (we will see it on the next example).
- rewriterRules
Another typical feature are the rewritable url's. For examplo, we could request to transform
"http://myspace.com" to "http://www.myspace.com", or "http://www.myspace.com/default.aspx"
to "http://www.myspace.com".
In this way, we will avoid that our SiteMap holds multiple URL that points to the same page.
In our example: "http://myspace.com" == "http://www.myspace.com" == "http://www.myspace.com/default.aspx" == "http://myspace.com/default.aspx".
Edit this kind of rules is also very easy. Foreach rule, whe will add a "<rule />" element, and inside of it we will add "oldPath" and "newPath" elements (we will see it on the next example).
Example
Therefore, and example of a "SubgurimSiteMapConfiguration" section will be:
<SubgurimSiteMapConfiguration>
<dataPath>~/App_Data/SubgurimSiteMap</dataPath>
<sitemapResponse>~/sitemapmeplease.aspx</sitemapResponse>
<forbiddenPaths>
<Path>~/Admin</Path>
<Path>~/PrivatePage.aspx</Path>
</forbiddenPaths>
<acceptedExtensions>
<extension>.htm</extension>
<extension>.html</extension>
</acceptedExtensions>
<rewriterRules>
<rule>
<oldPath>http://myspace.com</oldPath>
<newPath>http://www.myspace.com</newPath>
</rule>
<rule>
<oldPath>http://www.myspace.com/default.aspx</oldPath>
<newPath>http://www.myspace.com</newPath>
</rule>
</rewriterRules>
</SubgurimSiteMapConfiguration>