I got this error:

Code:
/path/to/.htaccess: </IfModule># without matching <IfModule># section
i think similar "without matching" .htaccess errors can be caused by invalid syntax of .htaccess content.

In my case result of this error was that somehow "#" was added right after "</IfModule>" instead of on the new line

OLD:
</IfModule>#

NEW:
</IfModule>
#