Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Windows Server 系統教學 >> Server 2003

IIS 6.0「不允許的父路徑」錯誤解決方案:啟用父路徑選項

編輯:Server 2003

錯誤現象

存取 ASP 網站時出現:「不允許的父路徑」,錯誤碼通常為 ASP 0175 : 80004005,提示 MapPath 參數中不允許 .. 字元。

根本原因

Windows Server 2003 IIS 6.0 為強化安全性,預設停用父路徑功能,導致使用 ../xxx.asp 相對路徑的舊版 ASP 程式無法執行。

解決步驟

  1. 開啟「Internet 資訊服務 (IIS) 管理員」。
  2. 右鍵對應網站 →「內容」。
  3. 切換至「主目錄」索引標籤 → 點擊「配置」。
  4. 在「選項」索引標籤中,勾選「啟用父路徑」。
  5. 確定儲存,重新整理網頁即可恢復正常。

補充說明

此設定屬於應用程式層級,若有多個虛擬目錄/應用程式,需逐一啟用。雖然開啟父路徑方便舊程式相容,但稍微降低安全性;新開發專案建議改用絕對路徑或 Server.MapPath 以避免相依性。

Copyright © Windows教程網 All Rights Reserved