raksmart活动促销

分享

写回答

发帖

怎样在一个空间安装多个网站

国外虚拟主机 国外虚拟主机 2578 人阅读 | 5 人回复

发表于 2008-8-5 23:57:19 | 显示全部楼层 |阅读模式

主机免费送的域名独大!后添加其他的域名都会显示在该域名下(当打开其他页面就会发现),类似www.aaa.com和www.bbb.com,访问www.bbb.com的页面就会显示类似www.aaa.com/sssss.html一样?

回答|共 5 个

一路同行

发表于 2008-8-6 09:05:30 | 显示全部楼层

把你的地址贴上来看看先

what

发表于 2008-8-6 11:18:25 | 显示全部楼层

应该在这个文件做做文章的吧  .htaccess.



# www.host114.org
# .htaccess main domain to subfolder redirect
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.

RewriteEngine on
# Change yourdomain.com to be your main domain.

RewriteCond %{HTTP_HOST} ^(www.)?yourdomain.com$

# Change ’subfolder’ to be the folder you will use for your main domain.

RewriteCond %{REQUEST_URI} !^/subfolder/

# Don’t change this line.

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

# Change ’subfolder’ to be the folder you will use for your main domain.

RewriteRule ^(.*)$ /subfolder/$1

# Change yourdomain.com to be your main domain again.

# Change ’subfolder’ to be the folder you will use for your main domain  2/41


# followed by / then the main file for your site, index.php, index.html, etc.

RewriteCond %{HTTP_HOST} ^(www.)?yourmaindomain.com$

RewriteRule ^(/)?$ subfolder/index.php [L]

what

发表于 2008-8-6 11:29:14 | 显示全部楼层

不会编写代码,应该可以让它同时执行两个指向操作,那样A域名就可以指向A文件夹,B域名就可以指向B文件夹!

一路同行

发表于 2008-8-6 11:41:19 | 显示全部楼层

添加域名的时候就制定好目录了 你是怎么操作的?

what

发表于 2008-8-6 12:25:19 | 显示全部楼层

lp送的域名(假如为a)就是指向public—html的,我就编写了上面的那个文件.htaccess文件放在public_html下面指向我的网站,如果不用.htaccess指向,那么该域名就默认为该主机的public-htm文件夹,再添加另一个域名b且指向文件夹b,他下面的页面就会显示出现在第一个域名a下面,例如访问www.b.com网页的任何一页,会显示这样的网址www.a.com/x.html,只是地址不好看,内容是正确的
您需要登录后才可以回帖 登录 | 注册

本版积分规则