溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例

發(fā)布時(shí)間:2021-10-15 17:33:59 來(lái)源:億速云 閱讀:124 作者:柒染 欄目:開(kāi)發(fā)技術(shù)

本篇文章為大家展示了如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例,內(nèi)容簡(jiǎn)明扼要并且容易理解,絕對(duì)能使你眼前一亮,通過(guò)這篇文章的詳細(xì)介紹希望你能有所收獲。

1、http://urlrewriter.net/  下載解壓縮后把Intelligencia.UrlRewriter.dll 文件添加引用到web工程里。

2.web.config配置:

如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例<configSections>
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例  <!--UrlRewriter-->
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例  <section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例 </configSections>
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例<system.web>
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例  <!--UrlRewriter-->
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例  <httpModules>
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例   <add type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" name="UrlRewriter" />
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例        </httpModules>
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例</system.web>
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例 </system.web>
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例 <!--UrlRewriter-->
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例 <rewriter>
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例  <rewrite url="~/test_([a-zA-Z]+).html$" to="~/Show.aspx?Code=$1" processing="stop" />
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例 </rewriter>
如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例

其中: <rewrite url="~/test_([a-zA-Z]+).html$" to="~/Show.aspx?Code=$1" processing="stop" />

若果code= abc的話,最終顯示的結(jié)果為"虛擬目錄名稱/test_abc.html" 。如果吧.html替換成 .aspx那就是"虛擬目錄名稱/test_abc.aspx"

3.IIS配置:
如果是用"虛擬目錄名稱/test_abc.aspx" 的話,不需要配置IIS. 使用了"虛擬目錄名稱/test_abc.html" 配置IIS的方法如下:
http://urlrewriter.net/index.php/support/installation/windows-server-2003/ 里面的圖9不準(zhǔn)確,準(zhǔn)確的為:

如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例

還有第八步中的”untick Verify that file exists.“要看仔細(xì)。否則重寫(xiě)HTML就無(wú)效。

4:備注

不要在"應(yīng)用程序擴(kuò)展"里“添加" .html的映射,否則正常的html將無(wú)法訪問(wèn)。

上述內(nèi)容就是如何理解Intelligencia.UrlRewriter.dll aspx重寫(xiě)為html實(shí)例,你們學(xué)到知識(shí)或技能了嗎?如果還想學(xué)到更多技能或者豐富自己的知識(shí)儲(chǔ)備,歡迎關(guān)注億速云行業(yè)資訊頻道。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI