The British Caving Association

Any views expressed are not necessarily those of the BCA
It is currently Sat 23 Feb 2019 15:58

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri 25 Oct 2013 11:16 
Offline
User avatar

Joined: Thu 16 Mar 2006 23:45
Posts: 469
Hi Cookie (and anyone else reading this),
Ive been having some really strange problems with a .htaccess file, causing 500 Internal Server Error messages and so I started writing this posting to ask you what was going on. Then I thought I should probably check the error log first, and then RTFM. I discovered something I never knew, which is that in Apache configuration files, the comment character # cannot appear "anywhere" in the line. http://httpd.apache.org/docs/2.2/configuring.html says ...
Quote:
Lines that begin with the hash character "#" are considered comments, and are ignored. Comments may not be included on a line after a configuration directive.

Youre going to tell me that's obvious. But Ive been using "comments after directives" for years (and with random strange problems, I have to admit). In the current case, my comment included the date of the modification, e.g. # altered on 25 Oct 2013, and I discovered by trial and error that the "2013" was causing the server to crash. I now realise that this was because it was trying to parse it as an IP address and crashing with the logged message "The specified IP address is invalid". Im clearly not the only one to fall into this trap because I based certain aspects of the structure of my .htaccess files on those of "another web designer within BCA" :-). So, Im wondering...

  1. If a comment after a directive does not cause a problem, is it OK to leave it in (performance issues aside), and
  2. Is there a comment delimiter that is valid after a directive? [I suspect not]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group