WordPress.org

Forums

.htaccess keeps getting overwritten (5 posts)

  1. recog
    Member
    Posted 10 years ago #

    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,

    --recog

    http://www.recycledcognition.com/

  2. James Huff
    Volunteer Moderator
    Posted 10 years ago #

    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).

  3. recog
    Member
    Posted 10 years ago #

    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:

    http://www.mundell.org/2005/03/26/216/

    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?

    Thanks,

    recog

    http://www.recycledcognition.com/

  4. James Huff
    Volunteer Moderator
    Posted 10 years ago #

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

  5. recog
    Member
    Posted 10 years ago #

    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.

    Thanks!

    --recog

    http://www.recycledcognition.com/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.