繁体   English   中英

.htaccess mod_rewrite给500错误

[英].htaccess mod_rewrite giving 500 error

我有一个运行良好的.htaccess文件。 但是,我只是将网站移到了共享主机上,所以一切都停止了工作。

这是我的.htacces:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/preview/([^/]+)/?$ preview.php?c=$1&m=$2&i=$3 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/page/([^/]+)/?$ index.php?c=$1&m=$2&p=$3 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/?$ index.php?c=$1&m=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.php?c=$1 [L]

我不确定,但我认为问题在于托管帐户不在根目录下。 这意味着我有一个域指向我的托管帐户,但是此域www.website.com指向了托管帐户上的/website文件夹。

错误消息是:

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 the actions you performed just before this error.

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

Apache Server at crstrains.com Port 80

在错误日志中什么也没有生成。

我希望www.website.com/Policies等于www.website.com/index.php?c=Policies,而且过去也是如此。 不再。 我怎样才能解决这个问题?

您能否尝试在RewriteEngine On正下方添加RewriteBase /

您是否尝试过在RewriteEngine on语句之后添加RewriteBase /website/指令?

Checkout rewritebase如何在.htaccess中工作,以获取有关如何使用RewriteBase更多信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM