mccalltd / AttributeRouting

Define your routes using attributes on actions in ASP.NET MVC and Web API.
http://mccalltd.github.io/AttributeRouting/
MIT License
416 stars 89 forks source link

Optional parameters allowing to redirect? #251

Open Madd0g opened 11 years ago

Madd0g commented 11 years ago

I love how much ugly code AR saves me, but I would love to also map some redirects with it.

For example, if I want to support /user/maddog, /u/maddog and /users/maddog, I'd have to write a lot of code to do clean 301 redirects (for SEO reasons, there should be one main URL for everything).

AR could support that in a second, but to do it in a nice way across the entire application for a lot of different things, I'd have to write something from scratch.

What do you think? Is there a way to extend the GET attribute and do it myself easily?

Thanks

waynebrantley commented 11 years ago

I think you should use the UrlRewrite IIS add in module (assuming you are hosting in IIS) Works great http://www.iis.net/downloads/microsoft/url-rewrite