Issue
Is it possible to comment out one or more sections of an .htaccess file, like you would using /* and */ in various programming languages?
Solution
Strictly speaking, .htaccess files only allow single-line comments: an hash character (#) at the beginning of a line lets the parser know that line should be ignored, i.e.:
# this is a comment in an .htaccess file and many other scripting languages
However, from a practical perspective it is possible to wrap any number of contiguous lines in an IF block (available from Apache 2.4). This effectively disables the lines within the block. For example:
<IF "false">
...disabled directives...
</IF>
That been said, a multi-line comment in many programming languages would allow more or less any content within it, i.e. plain english rather than viable code. Conversely, the content of an IF block as mentioned above must be composed of proper .htaccess directives and regular single-line comments - an http 500 error will be generated otherwise.
Answered By - manu3d Answer Checked By - David Marino (PHPFixing Volunteer)
 
 Posts
Posts
 
 
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.