.htaccess & 500 Internal Server Error
On this page
The 500 Internal Server Error may show if
.htaccess
contains syntax errors.
The 500 Internal Server Error may appear under the following error messages:
- 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.
- Internal Server Error. The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server log.
- 500 Internal Server Error. Oops, something went wrong. Try to refresh the page or feel free to contact us if the problem persists.
Confirmthat the 500 Internal Server Error is due to an incorrect
.htaccess
file configuration
by removing all textfrom the
.htaccess
file. Save the changes and reload the page.
Fix 500 Internal Server Error
Enable Mod_Rewrite
The 500 Internal Server Error appears if the
Mod_Rewrite
Apache module is disabled. You can spot this if the
AllowOverride
directive is set to
None
in
httpd.conf
.
To fix the 500 Internal Server Error, follow these steps:
Enable the
Mod_Rewrite
module by updating theAllowOverride
directive fromNone
toAll
. This directive is found in thehttpd.conf
, at the<Directory>
section:<Directory /var/www/mydomain_com> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory>
Update the
.htaccess
to use theRewriteEngine on
directive:RewriteEngine on RewriteCond %{HTTP_HOST} ^mydomain\.com [NC] RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301,NC]