error file .htaccess 500 Internal Server Error

烂漫一生 提交于 2019-12-12 04:35:44

问题


I have a problem with installing a php script coupon

if load .htaccess file

error page

Internal Server Error

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

Please contact the server administrator at webmaster@lefrasibelle.com 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.

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

this is my .htaccess file

Options -Multiviews

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

What could be your problem?


回答1:


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:

Detecting mod_rewrite using 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.

Also note that this line is not needed at all for using mod_rewrite, what activates mod_rewrite is RewriteEngine On.



来源:https://stackoverflow.com/questions/46744860/error-file-htaccess-500-internal-server-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!