23

Bluehost 主域绑定到任意目录

分类:BlueHost, 互联网 | 点击量919次 | 给我留言

发现自己的blog在public_html文件下的文件越来越多,而所有后添加的域名绑定的目录都在这个文件下,所以这个目录变得越来越乱,这个问题终于在我晕头转向找不到需要的文件的时候得到了我的高度关注^_^,在晚上找到了解决办法,在这里分享给同样使用的朋友。

修改 .htaccess 代码如下:

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

# Do not change this line.

RewriteEngine on

# 修改yourdomain.com为你的主域.

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

# 修改 ’subfolder’为你希望主域绑定到的目录的名字.

RewriteCond %{REQUEST_URI} !^/subfolder/

# Don’t change this line.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# 修改 ’subfolder’为你希望主域绑定到的目录的名字.

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

# 修改yourdomain.com为你的主域.
# 修改 ’subfolder’为你希望主域绑定到的目录的名字.
# 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]

官方原文地址:http://helpdesk.bluehost.com/kb/index.php?x=&mod_id=2&id=394

标签:,

相关日志

  • 标签 :  ,
  • 原文链接 : http://www.longlan.net/longlan/274
  • 转载原创文章请注明 : 华丽的忧伤
  • 收藏到 : Google书签 新浪ViVi 365Key网摘 天极网摘 我摘 POCO网摘 博采网摘 YouNote网摘 和讯网摘 博拉网 igooi网摘 I2Key网摘 天下图摘 百特门网摘 Del.icio.us Yahoo书签 奇贴 QQ娱乐摘 添加到Digg! 添加到Facebook!
  • 评论暂缺

    (Required)
    (Required, will not be published)