Support » Fixing WordPress » .htaccess keeps getting overwritten

  • I’m using mod_rewrite to create permalinks, and I’ve further modified my .htaccess file to do some additional redirects. The problem is that this file has reverted to it’s pristine state (just the default redirect related to permalinks) twice in the past week. I can’t figure out how/why this is happening, but .htaccess is seemingly being overwritten, perhaps by WP? I haven’t modified the permalinks during this time, so that shouldn’t have a caused an overwrite.

    Has anyone else had trouble with losing info from .htaccess? If so, how did you fix it? If not, can you suggest any ways of preventing this in the future? Thanks,


Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator James Huff


    Make sure than any additions made to the .htaccess file are place outside of the “# BEGIN WordPress” and “# END WordPress” tags. WordPress will manage whatever is inside those tags (and that includes deleting foreign entities).

    Doh! That’s likely what happened. However, some of the redirects that I’m doing involve the modification of the WP redirects. In other words, I’ve modified the feed redirects following this blog entry:

    to redirect request to feedburner. This requires modification of the WP section.

    As a temporary fix, I’ve made the file read only (i.e., no write permissions). Are there other functins besides modifying the permalinks that would require WP to be able to write to this file? In other words, is removing the write privileges going to ‘break’ any WP functionality?



    Moderator James Huff


    As long as you remember to enable write privileges before you write a new page, you’ll be fine.

    Okay, that explains it. I haven’t changed anything with regard to permalinks in the past week, but I did play around with creating a page. That must have triggered the overwrite. I have locked down the file and just need to remember to add write privileges (and to copy the mods that I’ve made within the WP block) before making a new page. I can then paste the mods back in and relock it.



Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘.htaccess keeps getting overwritten’ is closed to new replies.