国产老熟女高潮毛片A片仙踪林,欧美喂奶吃大乳,狠狠爱无码一区二区三区,女神的私人医生动漫免费阅读

新聞建站cms系統、政府cms系統定制開發

廣州網站建設公司-閱速公司

asp.net新聞發布系統、報紙數字報系統方案
/
http://m.tjsimaide.com/
廣州網站建設公司
您當前位置:首頁>網站技術

網站技術

利用IIS目錄改版實現301轉向(全站重定向)

發布時間:2014/10/15 20:27:24  作者:Admin  閱讀:589  

廣告:

1. 利用程序跳轉

asp.net 3.1

#region 301轉向

public static void To301(string path)

{

HttpContext.Current.Response.Clear();

HttpContext.Current.Response.StatusCode = 301;

HttpContext.Current.Response.AppendHeader("location", path);

HttpContext.Current.Response.End();

}

#endregion

asp 301

<%@ Language=VBScript %>

<%

Response.Status=”301 Moved Permanently”

Response.AddHeader “Location”, “http://www.****.cn/articles/301/”

%>

php 301

header(”HTTP/1.1 301 Moved Permanently”);

header(”Location: http://www.****.cn/articles/301/”);

exit();

jsp 301

<%

response.setStatus(301);

response.setHeader( “Location”, “http://www.****.cn/” );

response.setHeader( “Connection”, “close” );

%>

2. 利用服務器iis實現轉向

iis,在要轉向的目錄(原目錄不要刪)右鍵,屬性-重定向到url,如:加$s$q參數

http://demo.53bk.com/shouji$S$Q  (注意:S和Q一定要大寫,不然不生效)

上面準確的url和資源永久重定向打勾。

3. IIs8.5和iis 7.5 :

要建一個目錄:里面web.cofig

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpRedirect enabled="true" destination="http://zaoyuan.ysneo.com$S$Q" exactDestination="true" httpResponseStatus="Permanent" />
</system.webServer>
</configuration>

http重定向---將請求重定向到此目標---http://m.tjsimaide.com$S$Q (將所有請求重定向到確切的目標(而不是相對于目標)打勾,狀態代碼設為永久( 301))

4、Apache下301轉向代碼

新建.htaccess文件,輸入下列內容(需要開啟mod_rewrite):

1)將不帶WWW的域名轉向到帶WWW的域名下

Options +FollowSymLinks

RewriteEngine on

RewriteCond %{HTTP_HOST} ^lesishu.cn [NC]

RewriteRule ^(.*)$ http://www.****.cn/$1 [L,R=301]

2)重定向到新域名

Options +FollowSymLinks

RewriteEngine on

RewriteRule ^(.*)$ http://www.****.cn/$1 [L,R=301]

3)使用正則進行301轉向,實現偽靜態

Options +FollowSymLinks

RewriteEngine on

RewriteRule ^news-(.+)\.html$ news.php?id=$1

將news.php?id=123這樣的地址轉向到news-123.html

5、Apache下vhosts.conf中配置301轉向

為實現URL規范化,SEO通常將不帶WWW的域名轉向到帶WWW域名,vhosts.conf中配置為:

<VirtualHost *:80>

ServerName www.****.cn

DocumentRoot /home/lesishu

</VirtualHost>

<VirtualHost *:80>

ServerName lesishu.cn

RedirectMatch permanent ^/(.*) http://www.****.cn/$1

</VirtualHost>

 

 

廣告:

相關文章
iis轉向
301轉向
cms新聞系統購買咨詢
掃描關注 廣州閱速軟件科技有限公司
掃描關注 廣州閱速科技
主站蜘蛛池模板: 搜索| 台前县| 大荔县| 晋江市| 黑河市| 丹寨县| 池州市| 福安市| 黑河市| 什邡市| 乃东县| 宣威市| 苍梧县| 平定县| 双鸭山市| 邓州市| 镶黄旗| 晋江市| 九台市| 和顺县| 逊克县| 图片| 游戏| 武功县| 石阡县| 衡阳市| 安丘市| 南城县| 常山县| 鹤岗市| 宁河县| 中山市| 五莲县| 凤阳县| 左权县| 武宣县| 将乐县| 木里| 丹棱县| 泾阳县| 连云港市|