raksmart活动促销

分享

写回答

发帖

Bluehost主域名怎么自定义指向路径?

BlueHost BlueHost 7804 人阅读 | 13 人回复

发表于 2011-1-10 18:37:53 | 显示全部楼层 |阅读模式

按照官方的说法是在public_html下加个.htaccess文件,参考下面的修改即可。但我改完老是出现500错误,连其他ADDON域也成500了。改了N次了还是这个问题。哪位大侠知道怎么搞啊,谢谢。

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

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

回答|共 13 个

开心私塾

发表于 2011-1-11 08:20:34 | 显示全部楼层

可以参考这里的来设置,请点击这里
RAKSmart

miniwikis

发表于 2011-1-12 09:53:32 | 显示全部楼层

还是500,试了N次了

开心私塾

发表于 2011-1-12 10:00:02 | 显示全部楼层

是你的.htaccess配置文件错误,导致的500错误。不行的话 你屏蔽掉这个配置文件就好了。

miniwikis

发表于 2011-1-12 10:02:00 | 显示全部楼层

屏蔽.htaccess这个文件吗?现在需要这个文件把主域指向子文件夹啊。

请教怎么屏蔽?谢谢。

开心私塾

发表于 2011-1-12 10:03:08 | 显示全部楼层

删除不就是屏蔽掉了,你好好看看你的规则路径,具体设置。

miniwikis

发表于 2011-1-12 10:10:52 | 显示全部楼层

检查好多次了,总是这个问题,请帮我看下吧。主域是dilituku.com,现在打算指向到public_html下的dilituku.com文件夹。.htaccess这样写哪里出问题了?
  1. # .htaccess main domain to subfolder redirect
  2. # Copy and paste the following code into the .htaccess file
  3. # in the public_html folder of your hosting account
  4. # make the changes to the file according to the instructions.

  5. # Do not change this line.

  6. RewriteEngine on

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

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

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

  10. RewriteCond %{REQUEST_URI} !^/dilituku.com/

  11. # Don’t change this line.

  12. RewriteCond %{REQUEST_FILENAME} !-f
  13. RewriteCond %{REQUEST_FILENAME} !-d

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

  15. RewriteRule ^(.*)$ /dilituku.com/$1

  16. # Change yourdomain.com to be your main domain again.
  17. # Change ’subfolder’ to be the folder you will use for your main domain
  18. # followed by / then the main file for your site, index.php, index.html, etc.

  19. RewriteCond %{HTTP_HOST} ^(www.)?dilituku.com$
  20. RewriteRule ^(/)?$ dilituku.com/index.php [L]
复制代码

开心私塾

发表于 2011-1-12 10:15:09 | 显示全部楼层

RewriteRule ^(/)?$ dilituku.com/index.php [L] 你子目录里面的首页文件是否是index.php
具体的我来测试一下。

miniwikis

发表于 2011-1-12 10:17:02 | 显示全部楼层

是index.php,刚传好dedecms的文件到dilituku.com文件夹下

casaland

发表于 2011-1-16 21:40:31 | 显示全部楼层

成功后,用浏览器访问,地址变成了www.yourmaindomain.com/subfolder/index.php

这个有什么办法解决吗,希望是

www.yourmaindomain.com/index.php
您需要登录后才可以回帖 登录 | 注册

本版积分规则