问题描述
我在安装php脚本优惠券时遇到问题
I have a problem with installing a php script coupon
如果加载.htaccess文件
if load .htaccess file
错误页面
服务器遇到内部错误或配置错误,并且 无法完成您的请求.
The server encountered an internal error or misconfiguration and was unable to complete your request.
请通过[email protected]与服务器管理员联系. 告知他们发生此错误的时间以及您采取的措施 在此错误之前执行.
Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.
有关此错误的更多信息可能在服务器错误中可用 日志.
More information about this error may be available in the server error log.
此外,在执行以下操作时遇到了500 Internal Server Error错误 尝试使用ErrorDocument处理请求.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
这是我的.htaccess文件
this is my .htaccess file
选项-多视图
<IfModule mod_rewrite.c>
# Tell PHP that the mod_rewrite module is ENABLED.
SetEnv HTTP_MOD_REWRITE On
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]
RewriteRule ^(admin) - [L]
RewriteRule ^(cache) - [L]
RewriteRule ^(installer) - [L]
RewriteRule ^(templates) - [L]
RewriteRule ^(ajax) - [L]
RewriteRule ^(plugins) - [L]
RewriteRule ^(thumbs) - [L]
RewriteRule ^go\.php - [L,QSA]
RewriteRule ^confirm_subscription\.php - [L,QSA]
RewriteRule ^rss\.php - [L,QSA]
RewriteRule ^sitemaps - [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]
</IfModule>
您可能有什么问题?
推荐答案
您在注释中说有问题的行是SetEnv HTTP_MOD_REWRITE On
,同时考虑到该行和第一行的注释,看来您正在使用代码根据此博客文章:
You say in the comments that the problematic line is SetEnv HTTP_MOD_REWRITE On
, taking into account that line and the comment from the first line it seems that you are using code based on this blog post:
由于博客文章解释了SetEnv HTTP_MOD_REWRITE On
是低于4.3.2 的PHP 版本的解决方法(该帖子来自2009年),您应该删除该行,因为现在不需要,此处所述的检测方法将改为使用 apache_get_modules()适用于当前版本的PHP.
Since the blog post explains that the SetEnv HTTP_MOD_REWRITE On
is a workaround for versions of PHP lower than 4.3.2 (the post is from 2009) you should just delete that line because is not needed nowadays, the detection method described there will use instead apache_get_modules() for current versions of PHP.
还请注意,使用mod_rewrite
根本不需要此行,激活mod_rewrite
的是RewriteEngine On
.
Also note that this line is not needed at all for using mod_rewrite
, what activates mod_rewrite
is RewriteEngine On
.
这篇关于错误文件.htaccess 500内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!