• I have a site using artemis theme with woocommerce. It has been working fine and not had any new plugins added. I suspect that plugins have been updated though.

    The site has started emptying the contents of the htaccess file when work is undertaken in wp-admin. It can be fixed by saving permalinks again.

    I have changed the permissions on .htaccess to 444 and this seemed to work but the problem occured after 1 hour of the client using wp-admin again, to edit and delete some products.

    I have tried switching themes and disabling plugins but the nature of the problem is such that it may break after a couple of edits in wp-admin or an hour. It is not consistent.

    Any ideas please?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    The file was cleared even with 444 permissions? That’s rather disconcerting. The code would need to be able to use chmod() on the file in order to be able to clear it. I’m not aware of any legitimate WP code that would do that. Typically, writableness is checked and if that fails, that’s the end of it, the process aborts.

    Just in case I’m wrong, be sure the WP portion of .htaccess has the # BEGIN and # END markers, and any similar plugin sections have something similar. These markers are used to limit what is changed in the file by script. If missing, file operations could bleed over to the rest of the file.

    You could try changing file ownership to some other user (super user required if you do not own the file). Set permissions back to 444. Then attempts by PHP to change permissions should fail.

    Is there something you can do to reliably cause whatever this flaw is to clear the file (even if with 666 permission if necessary)? Without a reliable test, debugging is going to be difficult.

Viewing 1 replies (of 1 total)

The topic ‘htaccess file being cleared’ is closed to new replies.