Lunarpages Web Hosting Forum

Author Topic: Bizarre 500 (Internal Server) errors on .htaccess  (Read 331 times)

Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6404
Bizarre 500 (Internal Server) errors on .htaccess
« on: January 23, 2019, 11:19:06 AM »
Last night my entire site went down in flames. This morning, no page could be loaded, all getting 500 errors. The Error Log in cPanel was filled with errors including the phrase "No comments are allowed here". Support merely informed me that I had a syntax error in my .htaccess and it was my job to find it. I found a broken comment:
Code: [Select]
deny from xxx.xxx.xxx.xxx  # yyyy-mm-ddwhere the # had been turned into a $. I was sure I hadn't done that (as I had successfully loaded pages after my last .htaccess edit).

I found an explanation for "No comments are allowed here" via Google (https://bugzilla.redhat.com/show_bug.cgi?id=1577584 and others) that the deny from and allow from lines no longer permit a following comment. Well, that's stupid. I guess the Apache .htaccess processor is so convoluted now that it's unmaintainable. Anyway, stripping off the comments (or splitting them off onto their own lines) fixes it.

I'm guessing that once again, LP tried to auto-patch my .htaccess files, and only succeeded in breaking them. Sigh. This is at least the second time this has happened. Why couldn't they hold off on the upgrade, inform all customers that they need to fix their .htaccess files, and do the upgrade some time later?

Update: I don't know if it happened at the same time, or earlier, but php.ini gives an error if your comment starts with a #. Apparently comments need to start with a ;.
« Last Edit: January 23, 2019, 11:27:34 AM by MrPhil »
Visit My Site

E-mail Me
-= From the ashes shall rise a sooty tern =-