Files
17168ERP/web/App_Code/RouteConfig.cs
yiming b04c07a5eb 權限與靜態檔控制改進:
- 修正 admin 目錄預設頁路由,避免 403.14 與不必要的延遲重導
- 停用未使用的 Sites 多站點初始化,減少應用程式啟動成本
- 修正 Response.Redirect 後未 return 的流程,避免 1.8 分鐘超時
- 將資料庫 Connection Timeout 降為 10 秒,加速失敗回應
- 將 runAllManagedModulesForAllRequests 設為 false,讓 JS/CSS 等靜態檔案直接由 IIS 回應
2025-11-12 20:45:34 +08:00

39 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web;
//using System.Web.Mvc;
using System.Web.Routing;
public class RouteConfig
{
/*
* # Resolve Home for each Area
* http://stackoverflow.com/questions/7842293/multiple-types-were-found-that-match-the-controller-named-home
*
* # Home Controller for Area admin
* http://stackoverflow.com/questions/17220106/mvc4-default-route-when-using-areas
* */
public static void RegisterRoutes(RouteCollection routes)
{
// Web Forms 專案不使用路由忽略
// 靜態檔案效能優化改在 web.config 的 <handlers> 和 <modules> 中設定
//routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
//routes.MapRoute(
// name: "thumb",
// url: "thumb/{*url}",
// defaults: new { controller = "thumb", action = "Index", id = UrlParameter.Optional },
// namespaces: new[] { "GayoWeb.Controllers" }
//);
//routes.MapRoute(
// name: "Default",
// url: "{controller}/{action}/{id}",
// defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
// namespaces: new[] { "GayoWeb.Controllers" }
//);
}
}