Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

请问 如果uchome是安装在文件夹下边 怎么实现泛解析

[复制链接]
tnrain 发表于 2009-9-25 22:16:59 | 显示全部楼层 |阅读模式
我的uchome 是装在
www.*******.com/home/

这样的  给用户搞二级域名  访问不到,请问这样如何搞?
回复

使用道具 举报

 楼主| tnrain 发表于 2009-9-25 22:46:02 | 显示全部楼层
问问.................
回复

使用道具 举报

jenkincei 发表于 2009-9-25 23:38:42 | 显示全部楼层
本帖最后由 jenkincei 于 2009-9-25 23:39 编辑

我是这样做的,利用php代码实现不同域名访问不同的页面
比如我的一个站点有bbs、home、supesite、等目录,我只需要在网站根目录加入一个index.php文件

我的代码代码如下:

<?php
switch ($_SERVER["HTTP_HOST"])
{
case "huaxiren.cn":
header("location:supesite/index.php");
break;
case "www.huaxiren.cn":
header("location:supesite/index.php");
break;
case "bbs.huaxiren.cn":
header("location:bbs/index.php");
break;
case "wiki.huaxiren.cn":
header("location:wiki/index.php");
break;
case "home.huaxiren.cn":
header("location:home/index.php");
break;
case "nic.welos.cn":
header("location:supesite/index.php");
break;
case "home.welos.cn":
header("location:home/index.php");
break;
case "bbs.welos.cn":
header("location:bbs/index.php");
break;
case "wiki.welos.cn":
header("location:wiki/index.php");
break;
case "192.168.0.250":
header("location:replace.htm");
break;
default:
header("location:supesite/index.php");
break;
}
?>

相信仔细看下就能明白什么意思,
域名的地方 case 后是域名,header("location 后是目录,这样以来如果我用http://home.huaxiren.cn访问,那就去了 home目录了,这样做有一个缺点就是
当我访问这些域名的时候浏览器地址栏还带有目录名,比如我用http://bbs.huaxiren.cn访问,浏览器地址栏显示的是 http://bbs.huaxiren.cn/bbs 不过我个人感觉影响不大,我挺喜欢的。
回复

使用道具 举报

 楼主| tnrain 发表于 2009-9-26 13:39:27 | 显示全部楼层
哦  谢谢楼上的
回复

使用道具 举报

【三石】 发表于 2009-9-26 16:43:50 | 显示全部楼层
本帖最后由 【三石】 于 2009-9-26 16:47 编辑

先说uch的二级域名的运作原理
其实uch的二级域名并不是真正意义上的二级域名,他只是在uch的index页面判断了来访的域名的“域”然后拿这个域来跟数据库里存储自定义域名的那个字段做配对,一致的就访问这个字段对应的id的空间。
只要让自定义二级域名首先访问到uch的index,让他们接上头就万事ok了!
我的解决方法:
把单独主机的默认网站设置为home,让二级域名到服务器时访问到home的index就可以了。虚拟主机没研究过怎么弄。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-9-12 16:42 , Processed in 0.116560 second(s), 14 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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