A site that broke every morning
A small business site went down most mornings, and the owner had been bringing it back by re-uploading one file. The real cause was the hosting company overwriting that file every night.
The objective
The site had been failing on and off for about five months. Every other morning the owner would upload a working .htaccess file, the site would come back, and it would hold until the next time.
His hosting support had checked the Apache and PHP error logs, found nothing, and told him it was badly written code or a plugin and that his developer should sort it out.
There's one odd thing about the site. It has PHP inside files with an .html extension. A server won't run those by default, so the whole site only works while the .htaccess file tells the PHP interpreter to parse .html files as well.
What I did
The host's own reply held the answer: they said their standard handler block gets written into .htaccess automatically. That was it. Their automation was putting the standard block back every night and stripping out the line the site depends on.
I explained to the owner what that line actually does and why the site can't run without it, so he could take a specific request to his host instead of a description of the symptom.
The host then set the immutable attribute on the file, which stopped their automation rewriting it.
Three years later the whole domain started returning a 404 after the host repaired something else on the account. I recognised the same cause from his description and made the change again.
The result
The morning failures stopped, after five months of the owner uploading a file by hand. When it resurfaced three years later, it took one message to identify and one order to fix.
“This guy is brilliant at sorting out website errors.”