Danny
Danny

Reputation: 1

error file .htaccess 500 Internal Server Error

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

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?

Upvotes: 0

Views: 1506

Answers (1)

Alberto Martinez
Alberto Martinez

Reputation: 2670

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.

Upvotes: 0

Related Questions