我有一个 ASP.Net 网站,在其中使用模块 Intelligencia.UrlRewriter (urlrewriter.net)。我在使用它将无 www 重定向到 www 时遇到问题,以避免搜索引擎将这两个网址作为两个不同的网站处理。
我尝试了以下方法:
<redirect url="http://thetotalsite\.it(.+)" to="http://www.thetotalsite.it$1" />
但它不起作用,或者更好的是,它“有时”起作用。例如,如果我尝试访问:http: //thetotalsite.it 它会重定向到 www.thetotalsite.it
相反,如果我在主机名后面有一些东西,例如: http ://thetotalsite.it/a/article-nice-name
它不会重定向。
怎么来的?
(Nd:我使用以下规则来处理文章的 url 重写:
<rewrite url="/a/(.+)$" to="/articoli/showarticle.aspx?c=$1"/>
)
提前致谢,