分享

写回答

发帖

[提问] 301重定向

GoDaddy GoDaddy 2025 人阅读 | 13 人回复

发表于 2011-4-9 13:36:19 | 显示全部楼层 |阅读模式

使用的是win主机安装网上的方法建了一个web.config放到网站根目录下
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WWW Redirect" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^bstwelder.com$" />
</conditions>
<action type="Redirect" url="http://www.bstwelder.com/{R:0}"
redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

怎么没生效呀?

301重定向要过一段时间才生效吗?

回答|共 13 个

还没想好

发表于 2011-4-9 13:51:12 | 显示全部楼层

在线等解答,

add.c

发表于 2011-4-9 13:57:11 | 显示全部楼层

重启一下IIS,参考GoDaddy主机iis相关设置教程

还没想好

发表于 2011-4-9 14:04:14 | 显示全部楼层

没有说怎么重启呀

lpj

发表于 2011-4-9 14:16:31 | 显示全部楼层

相当于重启,还不行的话这样试试
<rule name="301 1" stopProcessing="true">
                    <match url="^(.*)$"/>
                    <conditions>
                    <add input="{HTTP_HOST}" pattern="^bstwelder.com$" />
                    </conditions>
                    <action type="Redirect" redirectType="Permanent" url="http://www.bstwelder.com/{R:0}" />
                </rule>

还没想好

发表于 2011-4-9 14:19:01 | 显示全部楼层

原帖由 lpj 于 2011-4-9 02:16 PM 发表
相当于重启

?相当于重启   是什么

lpj

发表于 2011-4-9 14:25:53 | 显示全部楼层

IIS修改是不是要把以前的关了再重新打开

还没想好

发表于 2011-4-9 14:29:23 | 显示全部楼层

还是没明白怎么弄

add.c

发表于 2011-4-9 14:32:48 | 显示全部楼层

原帖由 还没想好 于 2011-4-9 14:04 发表
没有说怎么重启呀

这个
6.重启应用程序池
点击Recycle App Pool,重启IIS

还没想好

发表于 2011-4-9 14:41:45 | 显示全部楼层

重启了 还是没效果呀
您需要登录后才可以回帖 登录 | 注册

本版积分规则