繁体   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