I have a URL scheme like this:
website.com/keywords
and I also have specific controllers:
website.com/controller/action
Sometimes the keywords may look an awful lot like controller URLs, or have some kind of "/url/thingy" on them. All of the keyword URLs will be stored in a database and return static content. What I'd love to be able to do, is have the "keywords" controller match first (it just uses {*}), and if the URL isn't found in the database, pop back out to the router, and let the matching continue.
I've got a workaround now which puts the universal matching router at the very end, and doing a 302 redirect to the proper controller, but that is a longer round-trip time and isn't necessary if I can pop back out.
Not that i dont want to do the leg work on this one because i would love to have the answer as well but i did have this bookmarked on the subject. custom route constraint
if you go down about half way you can see how to create your custom route contraint; just search for Listing 2 – NotEqualConstraint.cs then you can pass in a cached list of those keywords or just have the custom route constraint hold onto the list of keywords itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With