IIS 6下301转向的简单方法

之前发过IIS下PHP实现的404页301跳转来实现http://old.com/r.html301转到http://new.com/r.html,今天发现是舍近求远了.利用IIS自己功能就可以完全实现301转向到特定URL,不用写任何东西.
打开IIS上站点的属性,切换到主目录选项卡下.
选择重定向到URL
然后勾选资源永久重定向(必须选,这样才能返回301状态,302对搜索引擎不友好)
然后勾选最上面的上面输入的准确URL
接着在重定向到那里输入目标URL,比如http://www.new.com$S$Q (注意:后面写上变量$S$Q,具体Redirect Reference可以看微软的文档)
点确定即可.

然后试试用老域名访问是不是301,而且重定向到对应的URL上了.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>