Curtis
Curtis

Reputation: 103428

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?

Upvotes: 3

Views: 1284

Answers (2)

vikas tripathi
vikas tripathi

Reputation: 1

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

Upvotes: 0

Mark
Mark

Reputation: 895

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.

Upvotes: 2

Related Questions