Tôi đã thử:Làm thế nào để chuyển hướng đến gốc ứng dụng bằng cách sử dụng mô-đun Rewrite URL IIS7?
1) Tôi cố gắng chuỗi rỗng đầu tiên:
<action type="Redirect" url="" redirectType="Permanent" appendQueryString="false" />
Kết quả:
HTTP 500.52 - URL Rewrite Module Error.
The substitution URL for the current action cannot be empty.
2) Có lẽ tôi nên bỏ qua url
thuộc tính:
<action type="Redirect" redirectType="Permanent" appendQueryString="false" />
Kết quả tương tự:
HTTP 500.52 - URL Rewrite Module Error.
The substitution URL for the current action cannot be empty.
3) Còn về cách ASP.NET:
<action type="Redirect" url="~" redirectType="Permanent" appendQueryString="false" />
cố gắng chuyển hướng đến {APP_ROOT}/~
.
4) thử cuối:
<action type="Redirect" url="/" redirectType="Permanent" appendQueryString="false" />
Đúng như dự đoán, nó chuyển hướng vào thư mục gốc của máy chủ ...
Tôi muốn tìm thấy một số giải pháp chung sạch sẽ. (. Tôi không thể sử dụng một số bê tông /myCurrentAppPath
)
+1 Ok. Cảm ơn bạn. –