提问者:小点点

错误文件. htaccess 500内部服务器错误


我在安装php脚本优惠券时遇到问题

如果加载。htaccess文件

错误页

内部服务器错误

服务器遇到内部错误或配置错误,无法完成您的请求。

请联系webmaster@lefrasibelle.com的服务器管理员,告知他们发生此错误的时间以及在此错误之前执行的操作。

有关此错误的详细信息可在服务器错误日志中找到。

此外,尝试使用ErrorDocument处理请求时遇到500内部服务器错误。

这是我的。htaccess文件

选项-多视图

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

你有什么问题?


共1个答案

匿名用户

您在评论中说有问题的行是SetEnvHTTP_MOD_REWRITEOn,考虑到该行和第一行的评论,您似乎正在使用基于这篇博客文章的代码:

使用PHP检测mod_重写

因为这篇博文解释说,上的SetEnv HTTP_MOD_REWRITE是低于4.3的PHP版本的一种变通方法。2(这篇文章是从2009年开始的)您应该删除这一行,因为现在已经不需要了,这里描述的检测方法将在当前版本的PHP中使用apache_get_modules()。

还要注意,使用mod_rewrite时根本不需要这一行,激活mod_rewrite的是RewriteEngine On