.htaccess automatically changes causing 500 error
-
Hi,
I apologize if a solution has already been posted in other areas of this forum but I was unable to find help, hence my post.
I keep getting a 500 error on all pages/posts on my site (including the dashboard and admin area). The only cause that I can see is that my htaccess file keeps being modified somehow by a script from this below (which works)
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTP_HOST} ^mysite\.com
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R=permanent,L]
# END WordPress
</IfModule>to this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule># END WordPress
</IfModule>which doesn’t work and causes 500 errors throughout my site.
I have tried to CHMOD the htaccess file to read only (doesn’t work either).
2 questions:
1. Why does this happen automatically?2. How can I stop it? It is doing my head in having to manually copy over a backup every time it happens.
Thanks in anticipation
- The topic ‘.htaccess automatically changes causing 500 error’ is closed to new replies.