浏览:18739 回复:51 打印

IIS下设置公司绑定二级域名的方法

绑定一级域名和二级域名都成功,没有出错

TOP

留个记号,等下来试试
不锈钢板 http://www.buxiugangban.net

TOP

顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶

TOP

仪器仪表市场 QQ:1302496104

TOP

所有都按这里步骤操作的,最后弄了个网页错误,谁知道是怎么回事?

急需解决在线等

Warning: require(../common.inc.php) [function.require]: failed to open stream: Permission denied in D:\wwwroot\diyib2b\company\index.php on line 4

Fatal error: require() [function.require]: Failed opening required '../common.inc.php' (include_path='.;C:\php5\pear') in D:\wwwroot\diyib2b\company\index.php on line 4
PHP Warning: require(../common.inc.php) [function.require]: failed to open stream: Permission denied in D:\wwwroot\diyib2b\company\index.php on line 4 PHP Fatal error: require() [function.require]: Failed opening required '../common.inc.php' (include_path='.;C:\php5\pear') in D:\wwwroot\diyib2b\company\index.php on line 4

TOP

大侠们,给看看这是个什么错误?

怎么解决?

TOP

用这套程序的多数是虚拟主机空间,自己没有iis管理权限,所以二级域名也就无法设置,请问,有没有折中的方式。

另外:阿帕奇的二级域名解析如何实现。

TOP

独立IP,支持泛解析

程序上可以实现了二级域名,同时也需要虚拟空间支持泛解析,目前提供独立IP的主机很少,我使用的是www.hushou.cn他们提供独立IP的虚拟主机价格很合理。买空间都送数据库。

TOP

原来的空间不支持绑定子目录,准备在本地试下。。。。
52电动工具网
http://www.52ddgj.com

TOP

我试了不行。显示无法显示。是邦定一级域名

TOP

此方法有一个地方没有说清楚,就是绑定 *.ABC.COM 到 COMPANY 目录

IIS 需要建立两个站点

第一个站点是:网站主站站点,绑定网站主目录(比如说:D盘的 DESTOON 目录)
第二个站点是:网站二级域名泛解析站点,梆定网站主目录下的 COMPANY 目录

=================================================

第一站点的配置方法:

在IIS站点名称上点击鼠标右键,选择属性-网站-高级,在“此网站的多个标识”中添加两个内容:
IP地址:全部未分配
端  口:80
主机头:www.abc.com

IP地址:全部未分配
端  口:80
主机头:abc.com

回到IIS主目录,将主目录绑定在网站根目录下

==================================================

第二站点的配置方法:

在IIS站点名称(第二个站点)上点击鼠标右键,选择属性-网站-高级,在“此网站的多个标识”中添加两个内容:
IP地址:全部未分配
端  口:80
主机头:(为空)

回到IIS主目录,将主目录绑定在 COMPANY 目录下
==================================================

其它的设置均可参照楼主的内容,在此补充一下。

TOP

引用:
原帖由 linyg 于 2009-8-28 14:52 发表
依楼主的方法。是不是相当于开两个空间,一个*.abc.com绑定空主机头,目录至company另外一个空间www.abc.com绑定根目录。。是不是这个意思。。

我在想,可不可以弄一个空间就行了。把www.abc.com和空主机头都绑定至根目录 ...
PHP跳转代码实现一个网站空间绑定多个域名,建立多个网站
实现方法如下:

先建立一个默认主页index.php
然后把A站放在A文件夹下
B站放在B文件夹下
C站放在C文件夹下


index.php网页文件如下
  • <?php
  • switch ($_SERVER["HTTP_HOST"])
  • {
  • case "www.a.com":
  • header("location:a/index.php");
  • break;
  • case "www.b.com":
  • header("location:b/index.php");
  • break;
  • case "www.c.com":
  • header("location:c/index.php");
  • break;
  • }
  • ?>


如果用户访问 www.a.com 程序跳转至 空间目录下 a/index.php
如果用户访问 www.b.com 程序跳转至 空间目录下 b/index.php
如果用户访问 www.c.com 程序跳转至 空间目录下 c/index.php


利用一个php文件通过浏览器输入的域名,判定他是要打开那个文件夹里的站点,来实现一个虚拟放置多个站点(缺点例如打开abc.com,在浏览器中看到的是abc.com/b因为站点在b目录下)

其他说明:如果虚拟主机不支持子目录绑定,这是唯一有效的办法

ASP版本

如果只有一个ASP空间,而你又想放置多个多个站点,这些代码可以帮到你

第一个

程序代码

<%
if Request.ServerVariables("SERVER_NAME")="www.dzhai.com" then
response.redirect "williamlong/index.htm"
else
response.redirect "index2.htm"
end if
%>



第二个

程序代码

<%
select case request.servervariables("http_host")
case "www.dzhai.com" '1
Server.Transfer("v3.htm")
case "www.6id.net" '2
Server.Transfer("i.htm")
case "www.write100.com" '3
Server.Transfer("write100.htm")
...... 继续添加 ......
end select
%>




第三个


程序代码

<%
if instr(Request.ServerVariables("SERVER_NAME"),"www.dzhai.com")>0 then
response.redirect "index.asp"
elseif instr(Request.ServerVariables("SERVER_NAME"),"www.6id.net")>0 then
response.redirect "x/index.asp"
elseif instr(Request.ServerVariables("SERVER_NAME"),"www.write100.com")>0 then
response.redirect "index3.asp"
end if
%>




第四个


程序代码

<%
if Request.ServerVariables("SERVER_NAME")="www.dzhai.com" then
response.redirect "index1.asp"
elseif Request.ServerVariables("SERVER_NAME")="www.6id.net" then
response.redirect "index2.asp"
elseif Request.ServerVariables("SERVER_NAME")="www.write100.com" then
response.redirect "index3.asp"
end if
%>



第五个


程序代码

<%
if Request.ServerVariables("SERVER_NAME")="www.dzhai.com" then
Server.Transfer("williamlong.htm")
elseif Request.ServerVariables("SERVER_NAME")="www.6id.net" then
Server.Transfer("moon.htm")
elseif Request.ServerVariables("SERVER_NAME")="www.write100.com" then
Server.Transfer("write100.htm")
else
Server.Transfer("other.htm")
end if
%>


JSP版本

<script>try {if( self.location == "http://玉米一/" ) {
top.location.href = "http://玉米一/目录";
}
else if( self.location == "http://玉米二/" ) {
top.location.href = "http://玉米二/目录";
}
else if( self.location == "http://玉米三/" ) {
top.location.href = "http://玉米三/目录";
}
else if( self.location == "http://玉米四/" ) {
top.location.href = "http://玉米四/目录";
}
else {document.write ("错误的访问地址")}} catch(e) {}</script>



详解:

1:首先,你的空间必须支持ASP,并且这个空间可以绑定下面所用到的两个域名,然后新建一个ASP

的首页文件,这个ASP文件中的代码这么写:
<%if Request.ServerVariables("SERVER_NAME")="XXXX.cn" then '第一个输入的网址
response.redirect "index.html"                               '将它转发到相应的文件夹
else%>

<%end if%>
<%if Request.ServerVariables("SERVER_NAME")="www.XXXX.cn" then response.redirect

"index.html"                 
else%>
<%end if%>

<%if Request.ServerVariables("SERVER_NAME")="XXXX.cn" then   '第二个输入的网址
response.redirect "soft/index.html"                               '将它转发到相应的文件


else%>

<%end if%>

<%if Request.ServerVariables("SERVER_NAME")="www.XXXX.cn" thenresponse.redirect

"soft/index.html"
else%>

<%end if%>


这个方法不利于seo

TOP

设置成功了。
我的网站

52电动工具网
www.52ddgj.com
52电动工具网
http://www.52ddgj.com

TOP

iis中如何使用啊

TOP

会员中心中点击产品的时候,,,会报错.... 要设置什么吗??

会员中心中点击产品的时候,,,会报错.... 要设置什么吗??

TOP

        

网站首页 | 联系方式 | 产品下载 | 在线反馈 | WAP | RSS | Archiver | 返回顶部 ©2008- Destoon.com. All rights reserved. Powered by Discuz! 6.0.0