I'd like to comment my .htaccess files, so I can remember why I did something. According to the Apache site:

Lines which begin with the hash character "#" are considered comments, and are ignored. Comments may not be included on a line after a configuration directive. Blank lines and white space occurring before a directive are ignored, so you may indent directives for clarity.

What this sounds like to me is, you can put comments at the beginning, but can't put them (anywhere) after directives. However, it COULD mean, you can't put them RIGHT after a directive - i.e. you have to leave a blank line.

Anyone know which interpretation is correct?

  • Bob

    i think what they are saying with "on a line after a configuration directive" means that
    SomeInstruction value #this is my comment
    is not allowed, however i put something like that in a .htaccess file and it didnt give a 500 error, and the directive worked as expected.
    but according to the rules you can do
    SomeInstruction value
    #the above is supposed to do .....

      Write a Reply...