WordPress.org

Ready to get started?Download WordPress

Forums

Internal server error (9 posts)

  1. rachelasm
    Member
    Posted 2 weeks ago #

    [ Moderator note: Moved to How To and Troubleshooting. ]

    Over the past 3 months my website has been experiencing an "500 internal server error", which has become increasingly more frequent so much so that these days my website can be effected once or twice a day.

    After quite a prolonged exchange of emails with my domain host, they have pretty much refused to provide any further help/assistance and advise that it is most likely the result of a plugin with my site.

    I've removed all but 4 plugins from my site. The only ones remaining are Jetpack, WordPress SEO, Recipe Card and Photo Protect) and the problem is continuing.

    With the help of a friend, I've managed to identify that the coding in my htaccess file is being automatically changed. I have read previous forums and have tried the suggestions (delete existing htaccess files, rename, etc). There seems to be a master code somewhere else which is creating the changes because if I rename or delete the existing file, then a new file named htaccess appears.

    Given I'm really not great with coding etc, an interim solution provided by my friend was to create another folder with the correct coding and whenever the error occurred I would access the folder and manually amend the text. This worked well for a while, but given the problem is now occurring 1+ times daily, this is no longer a long term viable solution. Can someone please help in directing me to where I'm most likely to find the coding which is generating the htaccess file and changes to text, or any other suggestion on how I can resolve the problem?

    Thank you in advance.

    Rachel

  2. So, does the Error 500 always seem to happen after the .htaccess file is modified? If so, what are the additions made to the .htaccess file?

  3. rachelasm
    Member
    Posted 2 weeks ago #

    It doesn't dramatically change the text, but rather seems to add addition text at random times.

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

    and then it is automatically changed to:

    <IfModule mod_rewrite.c>

    # 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

    Typically, the site still works when its only changed once, but for some reason it can be repeated numerous times. Eg. I amended the htaccess file this morning, however I've just logged back in to get a copy of the amended text and it's been replicated more than 80 times in the past 5 hrs. At the moment the website is still working but no doubt its about to crash again shortly...

  4. rachelasm
    Member
    Posted 2 weeks ago #

    Sorry, to clarify on the above, sometimes the site crashes when the text is only amended once, and other times, like today, it is working despite all the replications, but it will eventually crash.

  5. Huh, yeah there's your problem. It should actually be:

    # 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

    But, in your changed version, there's an extra <IfModule mod_rewrite.c> which is never closed. So, your .htaccess file is one big if statement with no end.

    There is definitely a plugin adding that, and the best way to find out is to pick a plugin to live without each day. Match the day with no .htaccess changes to the plugin that was deactivated that day, and you have found the culprit.

    Jetpack does not modify the .htaccess file, so you can keep that one on the whole time for sure.

    To be honest, the troubleshooter in me wants to start with WordPress SEO, as I know that does modify the .htaccess file, but the WordPress user in me would hate to turn off an SEO plugin, so I guess save that for last.

    Start with Photo Protect, and then Recipe Card the next day, and finally WordPress SEO.

  6. rachelasm
    Member
    Posted 2 weeks ago #

    Hi James, thanks so much for your help.

    One last thing. Once I find the culprit, should I contact the plugin developer or would you recommend just finding another similar plugin?

  7. Whichever one you're most comfortable with.

    I'd recommend at least letting the developer know that you ran into this problem, but if you're more comfortable finding an alternative, that is perfectly understandable.

  8. rachelasm
    Member
    Posted 2 weeks ago #

    Thanks again James for your help. Cheers.

  9. You're welcome!

Reply

You must log in to post.

About this Topic