When you update your blog’s settings it writes over everything between # BEGIN WordPress
and # END WordPress
.
Put your rewrite rule in its own block, eg:
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteRule ^calendar/([^/\.]+)/([^/\.]+)/?$ wp-calendar.php?year=$1&month=$2 [QSA,L]
RewriteRule ^calendar/?$ wp-calendar.php [QSA,L]
</ifmodule>
# BEGIN WordPress
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</ifmodule>
# END WordPress