Search code examples
asp.netregexsitemapwildcardweb.sitemap

Use URL WildCard in web.sitemap?


I have a rewritten URL on my site for search purposes such as:

/Search-Results/Keywords-Here.aspx
/Search-Results/abc.aspx
/Search-Results/Query.aspx

Obviously the different possibilites here are endless. Therefore, is there a way of putting something like the following in my web.sitemap?:

/Search-Results/*.aspx

This way it'll map anything. Perhaps theres a RegEx way of doing it?


Solution

  • To the best of my knowledge the default sitemap stuff in asp.net doesn't handle url rewriting very well but having worked on ASP.NET MVC sites I discovered this MVC site map provider:

    http://mvcsitemap.codeplex.com/

    I think it's likely that you will need to look at a custom site map provider for what you're trying to do if you're using WebForms.