Why does this work:
RewriteRule (.+)/$ $1
RewriteRule (.+)/$ $1 [L] #bla bla bla
RewriteRule (.+)/$ $1 #bla bla bla
The last rule doesn't work because the comments aren't really comments. Comments in htaccess must begin with a
# (must be at the start of a line), and not arbitrarily anywhere.
In the second case, the
#bla bla bla is interpreted as a 4th parameter of the
RewriteRule directive, which is simply ignored.
In the last case, the
#bla bla bla is interpreted as a 3rd parameter, which in the
RewriteRule's case is where the flags go, and
#bla bla bla isn't any flags that mod_rewrite understands so you get an error.