WordPress.org

Ready to get started?Download WordPress

Forums

Fast Secure Contact Form
[resolved] .htaccess being edited incorrectly (7 posts)

  1. armst174
    Member
    Posted 1 year ago #

    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/

  2. Mike Challis
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. armst174
    Member
    Posted 1 year ago #

    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!

  4. Mike Challis
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  5. armst174
    Member
    Posted 1 year ago #

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

  6. Mike Challis
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  7. armst174
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic