Plugin for conditional redirect

if ( ! isset( $_SERVER['HTTP_REFERER'] ) AND 'your_page1' !== $_SERVER['HTTP_REFERER'] )
{
    exit( wp_redirect( $target, 301 ) );
}