title: Woocommerce Restrict My Account Page but NOT Lost Password Page
body: <p>I have a WordPress site with Woocommerce. In Woocommerce, Lost Password URL merges with My Account page <code>(www.site.com/my-account/lost-password/)</code>.</p>
  
  <p>Then I create a redirect function that will redirect non-logged in users when they hit "My Account" page to "Login" page. This means I limit them too to access the Lost Password page.</p>
  
  <pre><code>add_action( 'wp', 'redirect' );
  function redirect() {
    if ( is_page(array('my-account', 'payment-screen', 'submit-resume', 'post-a-job')) &amp;&amp; !is_user_logged_in() ) {
        wp_redirect( home_url('/login') );
        die();
    } elseif ( is_page(array( 'register', 'login' )) &amp;&amp; is_user_logged_in() ) {
        wp_redirect( home_url('/my-account') );
        die();
    }
  }
  </code></pre>
  
  <p>I want to restrict non-logged in users only for <code>www.site.com/my-account/</code> and redirect them to <code>www.site.com/login/</code> but NOT <code>www.site.com/my-account/lost-password/</code>. How can I do that?</p>