域名頻道-專業(yè)提供域名注冊(cè),網(wǎng)站空間,集團(tuán)郵局等服務(wù)
    [ ICP備案專題 ]  
 
首頁 域名注冊(cè) 虛擬主機(jī) 海外主機(jī) VPS主機(jī) 網(wǎng)店主機(jī) 集團(tuán)郵局 應(yīng)用服務(wù) 網(wǎng)站建設(shè) 軟件開發(fā) 客戶中心
如何設(shè)置Outlook
 
Outlook設(shè)置演示
如何設(shè)置Foxmail
 
Foxmail設(shè)置演示
CuteFtp的使用方法
 
CuteFTP設(shè)置演示
PASV 模式設(shè)置演示
FlashFXP設(shè)置演示
FlashFXP(中文)演示
數(shù)據(jù)庫連接
 
連接SQL Server數(shù)據(jù)庫
Mysql數(shù)據(jù)庫管理方法
虛擬主機(jī)使用注意事項(xiàng)
 
使用php注意事項(xiàng)
使用jsp注意事項(xiàng)
使用servlet注意事項(xiàng)
使用perl注意事項(xiàng)
使用jmail注意事項(xiàng)
使用upload注意事項(xiàng)
使用fso注意事項(xiàng)
ASP實(shí)現(xiàn) URL 轉(zhuǎn)發(fā)
如何進(jìn)行網(wǎng)站備案
   
  當(dāng)前位置:首頁 > 幫助信息 > ASP實(shí)現(xiàn) URL 轉(zhuǎn)發(fā)
 
ASP實(shí)現(xiàn) URL 轉(zhuǎn)發(fā)

URL轉(zhuǎn)發(fā)功能是域名注冊(cè)后的增值服務(wù)。所謂URL轉(zhuǎn)發(fā),是通過服務(wù)器的特殊設(shè)置,將訪問您當(dāng)前域名的用戶引導(dǎo)到您指定的另一個(gè)網(wǎng)絡(luò)地址。例如,URL轉(zhuǎn)發(fā)可以讓用戶在訪問http://www.abc.com時(shí),自動(dòng)轉(zhuǎn)向訪問http://www.otherdomain.com/somedir/other.htm

但通過URL轉(zhuǎn)發(fā)訪問網(wǎng)站不是一種非常理想的網(wǎng)站訪問方法,由于URL轉(zhuǎn)發(fā)服務(wù)器受攻擊的概率較高,影響URL的正常轉(zhuǎn)發(fā)。

為了避免這種情況,我們可以通過另外一種方法實(shí)現(xiàn)URL的功能, 例如我們希望鍵入 www.help.com 能直接訪問到 http://nrfpj.cn/help/default.asp,
那么
首先在 nrfpj.cn 的網(wǎng)站上綁定 www.help.com :
然后在 nrfpj.cn 網(wǎng)站的默認(rèn)首頁(例:default.asp或者index.asp)中加入以下代碼:

<%

dim url
url=request.ServerVariables("HTTP_HOST")
if url="www.help.com" then
response.Redirect("http://nrfpj.cn/help/default.asp")
end if

%>


如果要實(shí)現(xiàn)隱藏轉(zhuǎn)發(fā),可以使用框架實(shí)現(xiàn),代碼如下:

<%

dim url,redirectUrl
url=request.ServerVariables("HTTP_HOST")
if url="www.help.com" then
redirectUrl="nrfpj.cn/help/default.asp"
end if

%>
<frameset framespacing="0" border="0" rows="0,100%" frameborder="0">
<frame name="top" scrolling="no" noresize src="nothing.htm" marginwidth="0" marginheight="0">
<frame name="main" src="<%=redirectUrl%>" marginwidth="0" marginheight="0" scrolling="auto">
<noframes>
<body>

<p>此網(wǎng)頁使用了框架,但您的瀏覽器不支持框架。</p>

</body>
</noframes>
</frameset>

 

 
 
關(guān)于我們 聯(lián)系方式 付款事宜 價(jià)格總覽 代理專區(qū) 網(wǎng)站地圖 虛擬主機(jī) 法律顧問 常見問題 友情鏈接

Copyright 2000-2013  域名頻道(nrfpj.cn) 版權(quán)所有
地址:上海市松江區(qū)榮樂東路2369弄18號(hào) 郵編:201620
客服電話: 021-67899136  值班電話:17317360079 傳真: 轉(zhuǎn)分機(jī)805
在線QQ咨詢:219854 QQ交流  714658643 QQ交流  MSN:chenlh@dns110.com   Email:support@dns110.com