Use URL WildCard in web.sitemap?
-
24-10-2019 - |
Question
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.
OTHER TIPS
Depending on how your handling the routing/url rewriting you may only need to use the path to the actual file that handles the requests as I think internally the application may see the actual file path rather than the rewritten url