站点可以采用泛域名解析,指向服务器中的同一目录下.但有时地址会好长的,如何处理短一些?
如http://www.skyestar.com站点,为了让用户abby用上自己申请的域名为http://abby.skyestar.com,采用了泛域名解析指向了http://abby.skyestar.com/regWeb/abby/default.htm,怎样地址栏中只显示http://abby.skyestar.com而不是http://abby.skyestar.com/regWeb/abby/default.htm?
请高手指点迷津!参与者有分!
如http://www.skyestar.com站点,为了让用户abby用上自己申请的域名为http://abby.skyestar.com,采用了泛域名解析指向了http://abby.skyestar.com/regWeb/abby/default.htm,怎样地址栏中只显示http://abby.skyestar.com而不是http://abby.skyestar.com/regWeb/abby/default.htm?
请高手指点迷津!参与者有分!
<!--#include file="CONN.asp" -->
<%
geturl=replace(Request.ServerVariables("HTTP_HOST"),"www.","")
geturl=replace(geturl,".rohu.net","")
geturl=replace(geturl,"'","")
set rs=Server.CreateObject("Adodb.RecordSet")
sql= "Select SiteName,url from [site] where user='" & geturl & "'"
rs.Open sql,conn,1,1
if not rs.EOF then
'response.Redirect(rs("url"))
%>
<html>
<head><title><%=rs("SiteName")%></title></head>
<frameset cols='*' rows='*, 0'>
<frame src='<%=rs("url")%>' frameborder='0' scrolling='Auto' noresize marginwidth='0' marginheight='0'>
<frame src="UntitledFrame-2"></frameset><noframes></noframes>
<!--
<noframes><body>Frame required.</body></noframes>
-->
</html>
<%
else
Response.Write "<script Language=Javascript>alert('该用户不存在?');location.href='reg.asp';</script>"
end if
rs.close()
conn.close()
set rs=nothing
set conn=nothing
%>这是一个ASP的,相信你也能看懂。没及时翻译哈。你看看,这就是在框架中处理的例子。很简单