找回密码
 注册
搜索
免费空间 免费域名 免费AI 老牌主机商首月仅1美分!27美元/年!Spaceship优惠码 Namecheap优惠码阿里云2核2G3M新老续费同享99元/年!
查看: 240|回复: 3

[程序代码] 根据域名跳转的代码(ASP/PHP)

[复制链接]
发表于 2009-4-10 22:13:45 | 显示全部楼层 |阅读模式
Submitted by rain on 2007, August 7, 3:23 PM. 技术
ASP/Visual Basic代码
  • <%   
  • if Request.ServerVariables("SERVER_NAME")="mcncc.com" then   
  • response.redirect "1.asp"
  • else if Request.ServerVariables("SERVER_NAME")="www.mcncc.com" then   
  • response.redirect "2.asp"
  • else   
  • response.redirect "404.html"
  • end if   
  • end if   
  • %>  

PHP代码
  • <?php   
  • switch ($_SERVER["HTTP_HOST"])   
  • {   
  • case
    "mcncc.com":   
  • header("location:mcncc.comhtml");   
  • break;   
  • case
    "www.mcncc.com":   
  • header("location:www.mcncc.com.html");   
  • break;   
  • case
    "aii.net.ru":   
  • header("location:aii.net.ru.html");   
  • break;   
  • case
    "aii.org.ru":   
  • header("location:aii.org.ru.html");   
  • break;   
  • case
    "www.1111.com":   
  • header("location:www.1111.com.html");   
  • break;   
  • case
    "1111.com":   
  • header("location:1111.html");   
  • break;   
  • }   
  • ?>  
发表于 2009-4-10 22:18:31 | 显示全部楼层
顶下....
发表于 2009-4-10 22:59:52 | 显示全部楼层
做个沙发吧!
发表于 2009-4-11 00:38:00 | 显示全部楼层
学习下
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|免费吧论坛

GMT+8, 2024-5-12 04:16 , Processed in 0.026774 second(s), 5 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表