将news.php?id=123这样的地址转向到news-123.html
Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^lesishu.cn [NC] RewriteRule ^(.*)$ [L,R=301]
2)重定向到新域名
<%@ Language=VBScript %> <% Response.Status=”301 Moved Permanently” Response.AddHeader “Location”, “ %>
3、ASP.Net下的301转向代码
Options +FollowSymLinks RewriteEngine on RewriteRule ^(.*)$ [L,R=301]
301重定向,也称为301转向。它的功效就是告知搜寻引擎,你的网址永恒的变换了,从而将原网址的权重全体定向到新的网址上面,信任良多人都会用到301重定向的。
新建.htaccess文件,输入下列内容(须要开启mod_rewrite):
1、ASP下的301转向代码
1)将不带WWW的域名转向到带WWW的域名下
6、JSP下的301转向代码
-->
5、CGI Perl下的301转向代码
<script runat=”server”> private void Page_Load(object sender, System.EventArgs e) { Response.Status = “301 Moved Permanently”; Response.AddHeader(”Location”,” } </script>
<% response.setStatus(301); response.setHeader( “Location”, “ ); response.setHeader( “Connection”, “close” ); %>
header(”HTTP/1.1 301 Moved Permanently”); header(&rdquo成都网页设计;Location: exit();
7、Apache下301转向代码
$q = new CGI; print $q->redirect(”
3)应用正则进行301转向,实现伪静态
Options +FollowSymLinks RewriteEngine on RewriteRule ^news-(.+)成都网页设计公司.html$ news.php?id=$1
4、PHP下的301转向代码
(责任编辑:admin) |