The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] My htaccess is automatically changing? (4 posts)

  1. WWDay3
    Posted 8 years ago #

    Hi. Sorry if this has been addressed, but I did a search and didn't find anything. Maybe I used incorrect search terms, I don't know.

    Anyway, twice now my .htaccess file, which I have added changes to, has automatically switched back to the default "out of the box" .htaccess. This happened once last week, and once this week. Fortunately, after last week's fiasco, I made a backup copy and was able to easily recover.

    Questions - *why* is my .htaccess changing on me? *How* do I stop it from happening in the future?


  2. moshu
    Posted 8 years ago #

    Is your .htaccess file writable (chmod 666)?
    Did you modify anything in your permalink settings?
    Did you create a new Page?
    Are your custom rules INSIDE the WordPress section of the .htaccess? (they shouldn't be to avoid WP rewriting them)

  3. WWDay3
    Posted 8 years ago #

    By "inside" do you mean between the #Begin WordPress and #End WordPress comments? Because if so, then yes they are. Here os the "original" WordPress file

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    Where should my changes be?


  4. likoma
    Posted 8 years ago #

    Aha, I didn't know I needed the #Begin WordPress and #End WordPress comments! (At least I'm assuming I do.) I've had a few sites where just saving a post added the code above even though I already had it in the .htaccess file, but I guess because WP didn't see the comments, it didn't "see" the code so wrote it again, breaking the file and breaking the site! I removed the duplicated code and all was well again. Whew. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic