更換域名自動(dòng)跳轉(zhuǎn)的404代碼

2023-11-18    分類: 網(wǎng)站建設(shè)

原問:
假設(shè)以前有個(gè)為:http://www.abc.com/
現(xiàn)在要更換一個(gè)新的:http://www.123.com/
怎樣才能讓http://www.abc.com/自動(dòng)跳轉(zhuǎn)到http://www.123.com/
我說的跳轉(zhuǎn)是在http://www.abc.com/帶有參數(shù)的時(shí)候,比如
http://www.abc.com/01/1.html 自動(dòng)跳轉(zhuǎn)到 http://www.123.com/01/1.html

如果定義一個(gè)404錯(cuò)誤,這個(gè)代碼怎么寫。
感謝 etangren
404.asp 你就這樣寫

CODE:[Copy to clipboard]<%
dim url
private Function GetUrl()
Dim ScriptAddress, M_ItemUrl, M_item
ScriptAddress = CStr(Request.ServerVariables("SCRIpT_NAME")) '取得當(dāng)前地址
M_ItemUrl = ""
If (Request.QueryString <> "") Then
ScriptAddress = ScriptAddress & "?"
For Each M_item In Request.QueryString
If InStr(page,M_Item)=0 Then
M_ItemUrl = M_ItemUrl & M_Item &"="& Server.URLEncode(Request.QueryString(""&M_Item&"")) &
"&"
End If
Next
end if
GetUrl = ScriptAddress & M_ItemUrl
End Function
%>
<%Response.Redirect "http://www.abc.com/"&Url&""%> 跳轉(zhuǎn)的

當(dāng)前文章:更換域名自動(dòng)跳轉(zhuǎn)的404代碼
路徑分享:http://www.muchs.cn/news4/295104.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站導(dǎo)航、全網(wǎng)營銷推廣搜索引擎優(yōu)化、企業(yè)建站、App開發(fā)、企業(yè)網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

手機(jī)網(wǎng)站建設(shè)