Why your site shows a 500 error after editing .htaccess
Apache reads .htaccess on every request, and when it hits an error it refuses to process the request — visitors see “500 Internal Server Error”. The validator finds the most common causes before you upload the file to the server.
What we check
- Unclosed or incorrectly nested
<IfModule>,<Files>and<FilesMatch>sections. - Sections not allowed in .htaccess:
<Directory>,<VirtualHost>,<Location>. RewriteRuleandRewriteCondsyntax: regular expressions, flags, number of arguments, and the presence ofRewriteEngine On.- Codes and paths in
RedirectandErrorDocument, andOptionsvalues. - Outdated Apache 2.2 syntax (
Order,Allow,Deny) andphp_valuedirectives that break sites on PHP-FPM.
A new file with typical settings is easy to put together in the .htaccess generator.