raksmart活动促销

分享

写回答

发帖

怎么把自己注册时的域名绑定到自己建的目录

国外虚拟主机 国外虚拟主机 1833 人阅读 | 6 人回复

发表于 2007-9-21 15:27:16 | 显示全部楼层 |阅读模式

怎么把自己注册时的域名绑定到自己建的目录,我上次看一次,但现在找不到了。

回答|共 6 个

大漠孤狼

发表于 2007-9-21 16:06:35 | 显示全部楼层

如何让主域名指向public_html下的子目录

编辑public_html目录下的.htaccess文件,加入如下语句.如果public_html下没有.htaccess文件,新建一个即可.

注意:将 yourmaindomain.com修改为你的域名,将subfolder修改为你要指向的public_html下的子目录.最后一行中的index.php修改为你的网站的主页名称.

# 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.)?yourmaindomain.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

# 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]

ggsnsj

发表于 2007-9-21 16:09:35 | 显示全部楼层

# Don’t change this line.

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d


这个怎以改的

ggsnsj

发表于 2007-9-21 16:13:35 | 显示全部楼层

要改那几个地方?能不能用红色标出来。做为教程置顶

ggsnsj

发表于 2007-9-21 16:17:06 | 显示全部楼层

怎么,我改了链不到我指定的文件夹

大漠孤狼

发表于 2007-9-21 16:19:44 | 显示全部楼层

正在写,就是yourmaindomain.com修改为你的域名,将subfolder修改为你要指向的public_html下的子目录.最后一行中的index.php修改为你的网站的主页名称.

改这几个,其他的不需要改

ggsnsj

发表于 2007-9-21 16:30:10 | 显示全部楼层

修改成功,跟大家分享一下。
www.ggsnsj.com是我的网址
改成你自己的

# www.ggsnsj.com
# .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.)?yourmaindomain.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

# 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]
RAKSmart
您需要登录后才可以回帖 登录 | 注册

本版积分规则