Internet Information Services,是由微軟公司提供的基于運行Microsoft Windows的互聯網基本服務。最初是Windows NT版本的可選包,隨后內置在Windows 2000、Windows XP Professional和Windows Server 2003一起發行。本文介紹在IIS6中.net項目偽靜態重寫路徑的配置方法圖解和示例。
1、右鍵點擊 要設置網站的網站
2、屬性 ——》主目錄 ——》配置——》
3、如右側窗口,找到 .aspx 擴展名——》編輯——》復制 可執行文件的路徑——》關閉
4、點擊 添加——》粘貼 剛復制的 可執行文件路徑
5、擴展名填寫 .html (如果是 .htm 或者 任意你想要的擴展都可以 前提是以后的應用程序擴展列表里邊沒有該擴展)
6、不選中 確認文件是否存在
7、確定
iis6 web.config 偽靜態配置方法
1、參數用()括起來,使用 $1 來獲得參數。
2、多個參數的時候使用&分割。
3、把Intelligencia.UrlRewriter.dll添加到bin目錄
<?xml version="1.0"?> <configuration> <configSections> <section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/> </configSections> <system.web> <httpModules> <add type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" name="UrlRewriter"/> </httpModules> </system.web> <rewriter> <!--首頁--> <rewrite url="~/default.html$" to="~/default.aspx" processing="stop"/> <!--新聞--> <rewrite url="~/news/list-([A-Za-z0-9-]*).html$" to="~/NewsList.aspx?typeUrl=$1" processing="stop"/> <rewrite url="~/news/list-([A-Za-z0-9-]*)-([0-9]*).html$" to="~/NewsList.aspx?typeUrl=$1&page=$2" processing="stop"/> <!--新聞詳細--> <rewrite url="~/news/([A-Za-z0-9-]*).html$" to="~/NewsDetail.aspx?url=$1" processing="stop"/> </rewriter> </configuration> |
就到這里,寫的還不錯吧,你有沒有看懂呢?歡迎留言。