金山域名频道-专业提供域名注册,网站空间,集团邮局等服务
    [ ICP备案专题 ]  
 
首页 域名注册 虚拟主机 独立主机 应用服务 集团邮局 网站建设 ShopEx网店 代理专区 客户中心 购物车
如何设置Outlook
 
Outlook设置演示
如何设置Foxmail
 
Foxmail设置演示
CuteFtp的使用方法
 
CuteFTP设置演示
PASV 模式设置演示
FlashFXP设置演示
FlashFXP(中文)演示
数据库连接
 
连接SQL Server数据库
Mysql数据库管理方法
虚拟主机使用注意事项
 
使用php注意事项
使用jsp注意事项
使用servlet注意事项
使用perl注意事项
使用jmail注意事项
使用upload注意事项
使用fso注意事项
ASP实现 URL 转发
如何进行网站备案
   
  当前位置:首页 > 帮助信息 > ASP实现 URL 转发
 
ASP实现 URL 转发

URL转发功能是域名注册后的增值服务。所谓URL转发,是通过服务器的特殊设置,将访问您当前域名的用户引导到您指定的另一个网络地址。例如,URL转发可以让用户在访问http://www.abc.com时,自动转向访问http://www.otherdomain.com/somedir/other.htm

但通过URL转发访问网站不是一种非常理想的网站访问方法,由于URL转发服务器受攻击的概率较高,影响URL的正常转发。

为了避免这种情况,我们可以通过另外一种方法实现URL的功能, 例如我们希望键入 www.help.com 能直接访问到 http://jinshan.dns110.net/help/default.asp,
那么
首先在 jinshan.dns110.net 的网站上绑定 www.help.com :
然后在 jinshan.dns110.net 网站的默认首页(例:default.asp或者index.asp)中加入以下代码:

<%

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

%>


如果要实现隐藏转发,可以使用框架实现,代码如下:

<%

dim url,redirectUrl
url=request.ServerVariables("HTTP_HOST")
if url="www.help.com" then
redirectUrl="jinshan.dns110.net/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>此网页使用了框架,但您的浏览器不支持框架。</p>

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

 

 
 
  关于我们 联系方式 付款事宜 网站地图 虚拟主机 金山资讯 常见问题  

Copyright 2000-2010  金山域名频道(jinshan.dns110.net)
 地址:上海市松江区新松江路1188弄37号 邮编:201620
电话: 021-67820741 67820742 67820743 传真: 转分机805 值班电话: 021-67820743

在线支持QQ: 219854  客户服务QQ:714658643  MSN:chenlh@dns110.com  Email: support@dns110.com