0
votes

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?

1
If you remove lines until it starts working, which line in particular is causing the error? - rickdenhaan
a moment I try to clear lines - Danny
SetEnv HTTP_MOD_REWRITE On - Danny
I've deleted this code and now it seems to work - Danny
That could be because "On" has a special meaning in htaccess files. Try SetEnv HTTP_MOD_REWRITE "On" instead - rickdenhaan

1 Answers

0
votes

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.