Search code examples
phpwordpress.htaccesshttp-status-code-500

500 internal server error every week


One of my websites built on wordpress have 500 internal server error after every 2-3 weeks, and I have to delete .htaccess every time to fix this and a new htaccess appears after that.

The strange thing about the problem is the htaccess that appears after deletion is no different from the one which is deleted.

This is a bad version of htaccess which I have deleted to get it working.

# BEGIN WordPres
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Solution

  • It is obvious to me that whenever you get server error code 500, the file permissions of .htaccess have changed. When .htaccess is created again it has new default permissions. So you must verify & investigate what/who is changing .htaccess permissions.