• Resolved G M

    (@blogaholic)


    Getting a 500 internal server error while editing .htaccess file. It’s permission is set to 444.

    Just to be on the safe side I’m renaming current .htaccess file to something else and uploading the current .htaccess file with added codes. (Yes renamed new file to .htaccess)

    This completely breaks my site both front-end & back-end giving error 500.

    https://www.ads-software.com/plugins/better-wp-security/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Are you using Apache 2.4 ?

    If so please make sure you have the mod_access_compat module loaded in Apache.

    In the next update release the iTSec plugin will support Apache 2.4 without the mod_access_compat module loaded.

    If the info provided above helps you solve the issue please mark this topic as ‘resolved’.

    dwinden

    Thread Starter G M

    (@blogaholic)

    Yup enabled that but that didn’t worked.

    Now I have disabled and deleted the plugin (before doing that unckecked all the options I’ve selected under settings panel)

    I still can’t edit .htaccesss file, gives me 500 error.

    So with the iTSec plugin deactivated and deleted how are you attempting to edit the .htaccess file ?

    What makes you think this is still an iTSec plugin issue ?

    Would it be possible to post the content of your .htaccess file ?

    dwinden

    Thread Starter G M

    (@blogaholic)

    Here is the code:

    # 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
    
    #Disable Directory Browsing
    Options -Indexes
    
    #Error Documents
    ?ErrorDocument 404 /404.php
    ErrorDocument 403 https://www.mydomain.com/access-denied/
    ErrorDocument 500 https://www.mydomain.com/server-error/
    ErrorDocument 400 https://www.mydomain.com/bad-request/

    Ok, so no iTSec plugin entries in the .htaccess file.

    As far as I can see this is not an iTSec plugin issue.
    If you think otherwise please explain why you think this is an iTSec plugin issue.

    Perhaps letting WordPress recreate the .htaccess file by disabling\enabling permalinks will solve your issue. It could be your current .htaccess file got corrupted somehow…

    dwinden

    I think you are dealing a site which is not enabled by SSL certificate.

    #Error Documents
    ?ErrorDocument 404 /404.php
    ErrorDocument 403 https://www.mydomain.com/access-denied/
    ErrorDocument 500 https://www.mydomain.com/server-error/
    ErrorDocument 400 https://www.mydomain.com/bad-request/

    The above lines are written by yourself or other user having root access, but not by ithemes security plugin.

    If your site is not having any SSL certificate, then change https to http for all instances. Since you uninstalled or deleted ithemes security, and getting 500 – internal server error, there is a greater possibility of misconfiguration in server side script, here it is .htaccess.

    I copy\pasted the posted .htaccess lines into my own .htaccess file and it turns out there is a hidden character at the beginning of the line:

    ErrorDocument 404 /404.php

    When you remove the hidden character the 500 internal server error is resolved. So indeed this is not an iTSec plugin issue.
    You are not correctly editing the .htaccess file.

    @*B.V.RammannaRaau*
    Using https does not seem to make any difference for this issue ??

    dwinden

    Thread Starter G M

    (@blogaholic)

    @dwinden

    Thanks a ton for pointing that out!!! It really worked like a charm.

    I was sure that it was not an issue with iThemes Security, but something wrong with .htaccess.

    Since default wp rewrite rules and error documents redirections are correct, I thought it was related to only https.

    hidden character at the beginning of the line:
    ErrorDocument 404 /404.php

    I have never experienced such an invisible character related server error. Yes, I can reproduce both on live and home servers, @dwinden is correct. I was surprised, the character invisible even on text editor.

    Tons of thanks to @dwinden for new lesson. Keep rocking brother.

    May I know in which application it can be visible?

    I just copy\pasted the posted .htaccess content into Windows WordPad and noticed there was some text formatting being applied on ErrorDocument.
    Then in my cPanel editor I just navigated character for character, using the right arrow button from my keyboard, through “ErrorDocument” and noticed that at a certain point I needed to enter the right arrow button twice to move the cursor one character. Then I knew for sure a hidden character exists.

    But surely there are other more visual methods to find hidden chars.

    dwinden

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Error 500 While UpdatingEditing .htaccess file’ is closed to new replies.