• On one of my WordPress installations, there appears to be a random variable that alters the syntax of the .htaccess file. When it first started, it would look like this:

    # BEGIN WordPress

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    and be modified to look like this:

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

    # END WordPress

    My server support believed this issue could be caused by either one or a combination of installed plugins. On the most recent reoccurrence they identified that the file had been modified when wp-cron.php was run (whenever a visitor came to the site). I tried to disable this, but the site went down again when the admin user tried to make a change to the site. The file now looks like this:

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

    # END WordPress

    When it should look like the above example. Has anyone got any idea what the hell could be causing this and how to resolve short of re-installing?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The first thing I would do is to make the file what it should be and then immediately set its permissions to 0404 (as recommended by BulletProof Security) so no plugin or whatever else can again ever change it. After that, the next thing that complains is your culprit.

    Thread Starter robmoriarty

    (@robmoriarty)

    Thanks for that suggestion. I did wonder whether file permissions might be a potential solution. I shall see what effect this has and report back if needed.

Viewing 2 replies - 1 through 2 (of 2 total)

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