2
votes

I get this 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.

content of my .htaccess :

AddType application/x-httpd-php53 php53 php

php_flag  log_errors on
php_flag  display_errors on
#php_value error_reporting 8
php_value error_reporting E_ALL
php_value error_log  /domains/vitrinsaz1.ir/public_html/error_log2

<IfModule mod_rewrite.c>

RewriteEngine on
RewriteCond %{HTTP_HOST} ^vitrinsaz1.ir$ [NC]
RewriteRule ^(.*)$ http://www.vitrinsaz1.ir/$1 [R=301,L]



RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

</IfModule>


order allow,deny
allow from all

I think my .htaccess is ok but when I remove the content of my .htaccess every thing become ok.

2
Look in the error logs to see the exact error message.Pekka
Check your name server settings aswell. Common cause of issue.Bigwater
.htaccess: Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configurationS.M_Emamian
How are you running PHP? php_* values in .htaccess can only be read with mod_php as far as I know (as in you need to use a different approach with php-fpm for instance).ojrask

2 Answers

0
votes

You have to add AllowOverride All in your default virtualhost config file (default path : /etc/apache2/sites-available/default) or for a specific virtualhost.

By default AllowOverride is set to None

0
votes

php_flag is not allowed in PHP CGI mode