How can I prevent redirects from mysite/page to mysite/wp path/page?

I have hidden that in this answer, so I duplicate it here as a separate solution:

<?php  # -*- coding: utf-8 -*-
/* Plugin Name: No admin short URLs */

remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );