redirect old pages by .htaccess

%postname% is not a mod_rewrite rewrite tag. You are going to have to write out the path. mod_rewrite operates before WordPress, or PHP, gets involved. You don’t have access to any of that functionality.

If your “contact” page– the page named “contact”– has ID 213 you shouldn’t have to do anything to redirect, though. This will happen when you enable pretty permalinks.

You can also redirect using WordPress functionality by doing something like:

function redirect_213() {
  if (is_page(213)) {
    wp_safe_redirect(wp_safe_redirect(home_url("https://wordpress.stackexchange.com/contact")));
  }
}
add_action('template_redirect','redirect_213');

This will probably perform slightly less efficiently than the .htaccess but you may not notice.