29

How do you comment out a block of text in the vhosts file?

Do I have to put pound/hash symbols (#) in front of EVERY line?

EMuentes
  • 562
  • 1
  • 8
  • 18

2 Answers2

39

Yes, you will have to put pound/hash symbols (#) in front of ALL the lines you want commented out. There are no 'block comments' tag/symbols.

Some text editors have column-mode editing, which means you can select multiple lines and edit text in all of them at the same time. You can use this feature to insert the # symbol in front of the lines you selected.

Samuel Liew
  • 76,741
  • 107
  • 159
  • 260
26

This is not a solution but a workaround. You can put the code you want to comment inside an IfDefine block, so it will be ignored unless a dumb variable is defined:

<IfDefine IgnoreBlockComment>
...
</IfDefine>

Source: https://serverfault.com/a/414428

Community
  • 1
  • 1
Gayolomao
  • 586
  • 4
  • 15