虛擬主機配置301轉(zhuǎn)定向的方法
作者:佚名 時間:2012-05-25 分享到:
301轉(zhuǎn)向(或叫301重定向,301跳轉(zhuǎn))是當用戶或搜索引擎向網(wǎng)站服務器發(fā)出瀏覽請求時,服務器返回的http數(shù)據(jù)流中頭信息(header)中的狀態(tài)碼的一種,表示本網(wǎng)頁永久性轉(zhuǎn)移到另一個地址。
一般的虛擬主機可以按以下方法來配置
請在您的網(wǎng)站主目錄wwwroot下通過配置web.config實現(xiàn)301跳轉(zhuǎn)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webserver>
<rewrite>
<rules>
<rule name="rule 1">
<conditions>
<add input="{http_host}" pattern="^linksj.com$" />
</conditions>
<action type="redirect" url="http://www.ktcbnqb.cn/{r:0}"
redirecttype="permanent"/>
</rule>
</rules>
</rewrite>
</system.webserver>
</configuration>