0
我嘗試做以下...ISAPI重寫,如果有.EXT文件存在,那麼允許它作爲一個文件夾的網址
如果叫一個頁面,然後login.asp
存在允許重寫它作爲/登錄/但做不允許直接訪問login.asp
。
這是我的代碼到目前爲止。
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.87
RewriteEngine On
# if file is not exists
RewriteCond %{DOCUMENT_ROOT}/$1 !-f
# if folder is not exists
RewriteCond %{DOCUMENT_ROOT}/$1 !-d
# From start to end, "^(\w+)[/]+$" only matches with one or more alphanumeric characters and "_".
# Alternatively can end with one or more slashes.
# Change [R = 302, L] to [L] if you want make a rewrite instead of redirect.
RewriteRule ^(\w+)[/]*$ /username.asp?username=$1 [L]
所以,如果你想象中的用戶類型www.web.com/contact
如果有一個名爲contact.asp
頁面也顯示重寫的內容。如果.asp頁面不存在,則會加載/user.asp?username=contact
中的內容以檢查它是否是用戶配置文件。
非常感謝!
Ç
我已經更新的問題,以使其更清晰。 – 2011-12-19 14:56:04