Friday, April 19, 2013

.htaccess - Error 500 - Internal Server Error

Error 500 - Internal Server Error



To remove this error, check the content of .htaccess. It should be like this. 

<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /your-web-project-directory-name/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /your-web-project-directory-name/index.php [L] <IfModule>

If Apache can’t understand any line in your .htaccess, it will cause an error.
When you try to access your web page, it generates the error.

A garbage line in .htaccess can create Internal Server Error.

Example:
Create a file name .htaccess, write your name into it, save it and put it in your web project directory. Now try to access the web page, it will give this error.

Define rewrite rule carefully in your .htaccess. If you write anything in .htaccess which apache can't understand, it will be the reason of Internal Server Error.

If rewrite module is not enabled and you are using rewrite engine in the .htaccess, you may have this error. To find a solution, click here or you can find another solution here.

No comments:

Post a Comment