My .htaccess file for WordPress keeps adding code to look like this:
# BEGIN WordPress
<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
AME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
I don’t need any code after the first “# END WordPress”
I don’t know what is changing it and I just updated WordPress to version 3.5 to try and fix the issue but it is still there :/ Anybody have this issue or know how to fix it?
2/5/2013 EDIT: I updated WordPress, my Theme (AIT’s Guesthouse), and WPML plugins and the issue seems to have disappeared. I’m still not sure which thing was causing it.
If anyone is still searching for this answer I had to do some research recently to solve the problem myself.
As it turns out WordPress can update your .htaccess whenever you modify your permalinks. I was experiencing the issue however based on a few stray plug-ins I attempted to update. I set the .htaccess file the way I wanted it and blocked any changes to the file by setting permissions to 644. You can also do 444 if that isn’t strict enough for you. I do SSH but Filezilla or a similar FTP/SFTP program will work.
Also as a tip for the proactive, try maintaining your site with version control (I use Git through BitBucket) and you can have logs that will tell you when and what WordPress changes. Incredibly useful!