次のようにルートを変更する MVC3 アプリケーションがあります。
public class DealsController : Controller
{
public ActionResult View()
{
return View();
}
[Authorize]
[HttpPost]
public ActionResult Add(DealViewModel newDeal)
{
// Code to add the deal to the db
}
}
私がやりたいのは、ユーザーが www.domain.com/deals/view をリクエストしたときに、 URL をwww.doamin.com/unsecure/deals/viewに書き換えたいということです。そのため、Authorize 属性を持たないルートは、unsecure という単語を追加して変更する必要があります。
注:アプリケーションにいくつかのコントローラーがあるため、これを一般的な方法で処理できるソリューションを探しています。