So I have an ActionName like so:
[ActionName("Chicago-Bears")]
public ActionResult ChicagoBears() {
return View();
}
Google has this indexed as: http://www.example.com/Teams/ChicagoBears
I’m stuck using IIS6 and have no access to IIS myself.
Of course now, it has a hyphen in it. So, Google will show a 404 if someone clicks on that link.
How do I setup a 301 redirect in this instance? I can’t create another method called ChicagoBears(), so…
Thanks guys.
UPDATE: This blog I referenced seems to no longer be available so I updated the link to reference the internet archive version.
Check out this blog post for a great solution*: https://web.archive.org/web/20160528185929/http://www.eworldui.net/blog/post/2008/04/25/ASPNET-MVC-Legacy-Url-Routing.aspx
Essentially what he is doing is creating a reusable class that can be used for multiple routes, and they just issue a permanent redirect to the specified Action method.
**Note: This is not my blog, but one that I simply came across.*