WordPress.org

Support

Support » Plugins and Hacks » [Resolved] .htaccess being edited incorrectly

[Resolved] .htaccess being edited incorrectly

  • I have been getting 500 Internal server errors with some weird code being added to my .htaccess file. See below for a few examples.

    I have disabled all plug ins that reference the .htaccess except this one. It appears as though it is attempted to be re-written and is just not fully being deleted or just random characters are somehow getting in there.

    I have check with my web host and no malware was found and no IP other than mine has accessed my files. I am also the only one who works on the website, and crashes have happened in evenings and overnight when I am not working. Any idea what’s causing the plug in to do this?

    Thanks for your help.

    Examples of broken .htaccess:
    —————————–
    # B# 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
    ———————————-
    # 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
    s
    ————————————-
    #<Directory /home/firstcom/firstcommercefinancial.com/html/wp-admin/>
    (This was a previous line in here that would have the # deleted, i since deleted the entire line).

    http://wordpress.org/extend/plugins/si-contact-form/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Mike Challis

    @mikechallis

    This plugin does not edit your .htaccess file. There is no code in it to even do that.

    WordPress permalinks settings can edit your .htaccess file, so maybe WordPress itself is doing that. That is all the help I have for that.

    Thanks for the quick response Matt. I saw the block of code in si-contact-form.php started with the comment

    // needed for making temp directories for attachments

    as a possible culprit which lead me here, but sounds like you’re Right. I’ll keep investigating elsewhere. Thanks for the help!

    Plugin Author Mike Challis

    @mikechallis

    OK I have take part of what I said back. Here is the correction: This plugin will only edit or add a .htaccess file in the attachment upload directory to prevent public viewing of it.
    /si-contact-form/attachments

    It will not edit or add a .htaccess file in any other directories.

    My attachment folder is empty (no hidden files either). Is it possible it could be editing the .htaccess in my html directory instead?

    Plugin Author Mike Challis

    @mikechallis

    No I do not think this is the problem.

    When this code adds the file, it will only add “Deny from all” to it.
    If one is already there it does NOT do anything because it has a “if not file_exists” logic wrapping the line that adds the file.
    It will not edit one at all.

    Thanks for the clarification, I’ll keep looking for the problem!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] .htaccess being edited incorrectly’ is closed to new replies.