簡體   English   中英

URL重寫:我的規則語法是否錯誤

[英]URL Rewrite: Is my syntax of the rule wrong

您好,我使用的是Smartasp,我允許我進行網址重寫。 我在web.config上放置了這樣的規則:

<system.webServer>
        <rewrite>
            <rules>
                <rule name="AmazonS3" stopProcessing="true">
                    <match url="http://www.blah/amazon/(.*)" />
                    <action type="Redirect" url="http://amazon.blah/{R:1}" logRewrittenUrl="true" redirectType="Permanent" />
                </rule>
                <rule name="AmazonS3 with port" stopProcessing="true">
                    <match url="http://www.blah.com:80/amazon/(.*)" />
                    <action type="Redirect" url="http://amazon.blah.com/{R:1}" logRewrittenUrl="true" redirectType="Permanent"/>
                </rule>

我嘗試讀取請求的URL的地方:www.blah.com/amazon/到amazon.blah.com。 輸入www.blah.com/amazon/后,瀏覽器未重定向到亞馬遜頁面...

在我輸入規則的本地計算機上,高亮顯示了一個重寫標簽,表明在system.webserver下無效重寫。 我想念什么嗎?

使用http嘗試這種方式:

<rule name="Page Redirect" stopProcessing="true">
  <match url="www.blah.com/amazon/"/>
  <action type="Redirect" url="http://amazon.blah.com" redirectType="Permanent"/>
</rule>

暫無
暫無

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

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