关于310重定向

来源:互联网 发布:狄克斯特拉算法 编辑:程序博客网 时间:2024/04/27 17:35

关于310重定向
301 Redirect
301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It's not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it's the safest option. The code "301" is interpreted as "moved permanently".

You can Test your redirection with Search Engine Friendly Redirect Checker

Below are a Couple of methods to implement URL Redirection

301重定向是网页更改地址后对搜索引擎友好的最好方法,这不难实现并且可以使特殊的页面在搜索引擎中保持优先等级(Rinking)。如果你改变了文件名或移动了位置,这个选择是安全的。代码‘301’的解释意思是‘已被永久移走’。
你可以用 Search Engine Friendly Redirect Checker 测试你的重定向
下面是是一组用URL重定向的重要方法
 

How to Redirect in PHP(在PHP中如何重定向)
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.dreambar.cn" );
?>

 

How to Redirect in ASP(在ASP中如何重定向)
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently" Response.AddHeader "Location", " http://www.dreambar.cn"
>

 

How to Redirect in ASP .NET(在ASP.NET中如何重定向)
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.dreambar.cn");
}
</script>

 

How to Redirect in ColdFusion(在ColdFusion中如何重定向)
<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="http://www.dreambar.cn">

 

How to Redirect with htaccess(如何用htaccess重定向)
Create a .htaccess file (if does not exists) in your root directory.在你的根目录下创建一个.htaccess文件(如果不存在)
Redirect permanent / http://www.dreambar.cn

 

IIS Redirect(IIS重定向)
In internet services manager, right click on the file or folder you wish to redirect

Select the radio titled "a redirection to a URL".

Enter the redirection page

Check "The exact url entered above" and the "A permanent redirection for this resource"

Click on 'Apply'
在 Internet 信息服务管理器中,用鼠标右键在你希望重定向的文件活目录上点击选择‘属性’;

选择‘重定向到URL’;

输入一个重定向页地址;

选中‘上面的准确地址URL’和‘资源的永久重定向’

单击‘应用’

 

How to Redirect HTML
Please refer to section titled 'How to Redirect with htaccess', if your site is hosted on a Linux Server and 'IIS Redirect', if your site is hosted on a Windows Server.

请参考 ‘如何用 htaccess 重定向’一节内容