Internal server error

Over the past 3 months my website has been experiencing an “500 internal server error”, which has become increasingly more frequent so much so that these days my website can be effected once or twice a day.

After quite a prolonged exchange of emails with my domain host, they have pretty much refused to provide any further help/assistance and advise that it is most likely the result of a plugin with my site.

I’ve removed all but 4 plugins from my site. The only ones remaining are Jetpack, WordPress SEO, Recipe Card and Photo Protect) and the problem is continuing.

With the help of a friend, I’ve managed to identify that the coding in my htaccess file is being automatically changed. I have read previous forums and have tried the suggestions (delete existing htaccess files, rename, etc). There seems to be a master code somewhere else which is creating the changes because if I rename or delete the existing file, then a new file named htaccess appears.

Given I’m really not great with coding etc, an interim solution provided by my friend was to create another folder with the correct coding and whenever the error occurred I would access the folder and manually amend the text. This worked well for a while, but given the problem is now occurring 1+ times daily, this is no longer a long term viable solution. Can someone please help in directing me to where I’m most likely to find the coding which is generating the htaccess file and changes to text, or any other suggestion on how I can resolve the problem?

Typically, the site still works when its only changed once, but for some reason it can be repeated numerous times. Eg. I amended the htaccess file this morning, however I’ve just logged back in to get a copy of the amended text and it’s been replicated more than 80 times in the past 5 hrs. At the moment the website is still working but no doubt its about to crash again shortly…

But, in your changed version, there’s an extra <IfModule mod_rewrite.c> which is never closed. So, your .htaccess file is one big if statement with no end.

There is definitely a plugin adding that, and the best way to find out is to pick a plugin to live without each day. Match the day with no .htaccess changes to the plugin that was deactivated that day, and you have found the culprit.

Jetpack does not modify the .htaccess file, so you can keep that one on the whole time for sure.

To be honest, the troubleshooter in me wants to start with WordPress SEO, as I know that does modify the .htaccess file, but the WordPress user in me would hate to turn off an SEO plugin, so I guess save that for last.

Start with Photo Protect, and then Recipe Card the next day, and finally WordPress SEO.