Follow standards instead of ugly solutions. Use WP filter (put inside functions.php):
add_filter( 'site_url', 'my_url_modifier', 10, 4 );
function my_url_modifier( $url, $path, $scheme, $blog_id)
{
if($url=='http://mywebsite.com/wp-login.php?action=lostpassword')
return 'http://your_link..';
else
return $url;
}
p.s. You should add other links there link example. Also, you can sanitise further parameters, like : if ($path=='wp-login.php')....