roots / wp-h5bp-htaccess

WordPress plugin that adds HTML5 Boilerplate's .htaccess
https://roots.io/plugins/html5-boilerplate-htaccess/
MIT License
153 stars 37 forks source link

.htaccess file is corrupted after WordPress update #14

Open QWp6t opened 9 years ago

QWp6t commented 9 years ago

Haven't had a chance to dive into this yet, but I'm going to guess that the event that triggers writing new .htaccess file is being fired more than once.

I'll play around with it this weekend.

VR51 commented 9 years ago

This happens to me too on one of my client's sites. Other sites seem to be okay.

The directives are being written to .htaccess automatically multiple times. The first manual write done when permalinks are manually saved is good. The automatic subsequent writes appear to use a non UTF8 character encoding so .htaccess gets corrupted.

QWp6t commented 9 years ago

For others who have this problem: just delete .htaccess and visit permalinks in admin panel. That's the current workaround until I figure out how to fix it. Just haven't had time. The fix shouldn't be too complicated, though ... hopefully.

VR51 commented 9 years ago

Only problem with the workaround is that it needs to be repeated frequently.

I was working on a site on a compromised server space when the H5BP bug reared up again a few hours ago. That's when I realised there was a bug in H5BP. Up until then I had thought I was just dealing with a hacker bot that had installed a number of shell scripts onto the server (the .htaccess file corrupted previously around the time of the hack).

When the H5BP bug showed today it rewrote the .htaccess file repeatedly every couple of minutes after each manual restoration of the .htaccess file.

To temporarily resolve the issue until patched I've disabled the H2BP plugin and added the .htaccess directives manually.

Thanks for replying so quickly.

VR51 commented 9 years ago

Wonder if it has anything to do with WooCommerce. WooCommerce is installed in both the sites where the bug exhibited.

QWp6t commented 9 years ago

Hmm, it's installed on the ones where I've experienced this issue as well. That's an interesting find. Thanks.