raksmart活动促销

分享

写回答

发帖

htaccess设置个性域名问题

BlueHost BlueHost 6901 人阅读 | 13 人回复

发表于 2011-4-21 14:13:19 | 显示全部楼层 |阅读模式

用thinksns做的网站,会员可以填写个性域名
htaccess内规则如下:

# 为了正常启用URL Rewrite,请将apache配置文件中“LoadModule rewrite_module modules/mod_rewrite.so”
# 前的注释去掉,并将apache的DocumentRoot开启AllowOverride
#
# 如下所示为apache下httpd.conf的代码片段:
# <Directory "YourDocumentRoot">
#   Options Indexes FollowSymLinks ExecCGI Includes
#   AllowOverride All
#   Order allow,deny
#   Allow from all
# </Directory>
#

# 是否开启URL Rewrite.
RewriteEngine On

# 根目录名称 [注意:前后都有"/"]
# 请将下面的“/thinksns/”替换成您的根目录名称。如:
# 如果您的站点地址为:http://abc.com,那么请将“/thinksns/”替换为"/"
# 如果您的站点地址为:http://abc.com/d/e/f,那么请将“/thinksns/”替换为"/d/e/f/"
RewriteBase /thinksns/

# Rewrite规则
RewriteRule ^/?([a-zA-Z0-9]+)$                                        index.php?app=home&mod=space&uid=$1&%{QUERY_STRING}  [L]

# /blog/8_123.html
RewriteRule        ^/?blog\/([0-9]+)_([0-9]+)\.html$        index.php?app=blog&mod=Index&act=show&id=$2&mid=$1&%{QUERY_STRING}  [L]


修改了RewriteBase /thinksns/之后上传到网站目录,可是直接导致500错误
请问各位前辈,这个还需要做什么工作才能正常吗?
上面说修改apache配置文件是在什么地方呢?

回答|共 13 个

微微百科

发表于 2011-4-21 14:33:57 | 显示全部楼层

试着将RewriteBase /thinksns/  改成 RewriteBase /

no.9527

发表于 2011-4-21 14:54:16 | 显示全部楼层

原帖由 微微百科 于 2011-4-21 02:33 PM 发表
试着将RewriteBase /thinksns/  改成 RewriteBase /



修改过了,还是不行

提示错误信息如下:
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

微微百科

发表于 2011-4-21 15:13:01 | 显示全部楼层

你咨询一下官方,看他们是否支持:“LoadModule rewrite_module modules/mod_rewrite.so”功能。

大漠孤狼

发表于 2011-4-21 17:42:36 | 显示全部楼层

看样子是.htaccess引起的错误,第一不要用记事本编辑这个文件,如果没有最可能的就是语法错误,至于是什么语法错误,建议你进入cpanel面板,点击 error log,如果是.htaccess配置引起的都会有显示

no.9527

发表于 2011-4-21 17:50:44 | 显示全部楼层

好的,我看看
RAKSmart

no.9527

发表于 2011-4-21 17:53:11 | 显示全部楼层

客服回复说是这个地方错误日志
Thank you for contacting Bluehost support! The error is caused by some code in a .htaccess file. The actual error that appears in the error log is this:

/.htaccess: Invalid command '\xef\xbb\xbf#'

大漠孤狼

发表于 2011-4-21 18:04:41 | 显示全部楼层

你看下错误提示里面详细的提示是什么,客服说的那句没看到
语法错误有时候是因为两句错误的合并成同一行或者同一行截断成两行引起的
看客服说的应该是语言错误引起的,这样的话就检查下.htaccess文件

no.9527

发表于 2011-4-21 18:12:58 | 显示全部楼层

回复 8# 的帖子

[Thu Apr 21 04:11:59 2011] [warn] RewriteCond: NoCase option for non-regex pattern '-f' is not supported and will be ignored

看到的是这个

no.9527

发表于 2011-4-21 18:16:36 | 显示全部楼层

[Thu Apr 21 04:16:08 2011] [error] [client 86.96.226.84] Handler for application/x-httpd-php5s returned invalid result code 70014, referer: http://24dzine.com/wp-admin/post.php?post=48&action=edit&message=10
您需要登录后才可以回帖 登录 | 注册

本版积分规则