网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > 代码交流
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

代码交流 ASP,PHP,JSP等网站源代码下载与交流。

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   IP: 61.139.126.97
Old 2006-10-15, 06:52 AM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default Asp实现多域名同一空间的处理实例

以天极网页陶吧和天极软件频道的域名地址为例:

  http://homepage.yesky.com/

  http://soft.yesky.com/

  这两个域名都是绑在同一个空间上,哈,但会跳到不同的目录,不是在IIS设置上实现的,只是一小段ASP代码,哈,。。。给出代码大家看看,虽然不是什么高深的东西,但挺实用的。

Quote:
<%
  '取得HTTP输入的值并付值到HTOST中
  host=lcase(request.servervariables("HTTP_HOST"))
  ‘开始条件跳转
  SELECT CASE host
  ' 如果HOST的值是soft.yesky.com/就选择事件case"soft.yesky.com/"的命令
  CASE "soft.yesky.com/"
  ' Below is the redirect command
  response.redirect "homepage/"
  CASE "homepage.yesky.com"
  response.redirect "/"
  'We use CASE ELSE to fix any other requests
  CASE ELSE
  response.redirect "/"
  END SELECT
  %>
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 11:08 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.