1

My rewrite rules and redirects are somehow being removed from my htaccess file. The iThemes Security plugin developer says iThemes doesn't remove anything from htaccess, so my question is what does? What could the culprit be?

(If it matters, my Wordpress install is in a subdirectory, but I'm referring here to the root htaccess.)

  • why is it writable? – Mark Kaplun Feb 20 '17 at 17:21
  • Good question. Then iThemes Security and WP Rocket (for caching) plugins do write to it - they just don't remove from it. – philraymond Feb 20 '17 at 17:27
  • Are your redirects inside the "# BEGIN WordPress" and "# END WordPress" lines? Whatever's inside there will be re-written by WordPress every time the permalinks are updated... I assume your plugins also use a similar mechanism - so make sure your own rewrites are always outside other people's blocks. – nibnut Feb 20 '17 at 21:14
  • Thanks, I think that's it, @MacPrawn - the permalinks in my case. Do you want to put that as an answer? – philraymond Feb 21 '17 at 0:40
  • the file should not be writable by the webserver and it is a potential security problem if it is. plugins that don't know better..... well after they do what they need you should change the permission manually – Mark Kaplun Feb 21 '17 at 3:51
0

Whatever's inside the "# BEGIN WordPress" and "# END WordPress" lines in your .htaccess file will be re-written by WordPress every time the permalinks are updated...

I assume your plugins also use a similar mechanism.

So make sure your own rewrites are always outside other people's blocks.

| improve this answer | |
0

I'd check two places: with the hosting company, and in server logs. Perhaps you're running Nginx rather than Apache and the host has disabled htaccess edits.

You could also try the old disable all plugins trick. Disable them, make your edits, and check back a few minutes later to see if your edits remain or revert. You can then turn on plugins one by one and do the same thing to figure out if one of them is the culprit. (Waiting a day might be safer in case it's something that wipes things on a daily basis.)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.