簡體   English   中英

使用IIS的URL重寫模塊將下划線替換為破折號

[英]replace underscore with dash using url rewrite module of iis

我有關於網址重寫模塊的問題。

我想對我的網站實施永久重定向(301)。 和網址是,我想永久重定向

http://demo.datadiary.com/search/product/ahmedab​​ad/ac_dealers

網址至

http://demo.datadiary.com/search/product/ahmedab​​ad/ac-dealers

提前致謝。

我找到了解決方案。 將以下內容放入您的web.config中,但請記住,主機必須在iis中安裝了Url重寫模塊。

<rule name="Imported Rule 1-2" stopProcessing="true">
                    <match url="(search/product/ahmedabad.*/[^/]*?)_([^/_]*)$" ignoreCase="false" />
                    <action type="Redirect" url="{R:1}-{R:2}" redirectType="Permanent" />
                </rule>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM