0

我正在尝试将非 www 重写为 www 域。

我试过规则:

<rewrite url="http://domain\.com(.+)" to="http://www.domain.com$1" />

但无济于事。它只是继续允许访问 http://domain.com

4

1 回答 1

1

您很可能指的是这个(“Intelligencia URL Rewriter”)。

如他们的文档中所述,您必须先将配置节处理程序以及其他配置设置添加到web.config文件中,然后才能开始添加重写/重定向规则。

更新

刚刚看到你修改了你的问题,所以可能你设法找到了配置问题。

对于您的域问题,我在我的一个项目中处理了类似的事情,如下所示:

<!-- Ensure that all are on the same top domain and sub domain. -->
<unless header="HTTP_HOST" match="www.zeta-producer.com">
    <redirect 
        url="^(.*)$" 
        to="http://www.zeta-producer.com$1" 
        processing="stop" />
</unless>
于 2011-06-27T18:45:41.017 回答