I have a WordPress website on which I have changed the default login url from “mydomain.com/wp-login.php” to “mydomain.com/login”. Currently my lost password URL is at “mydomain.com/login?action=’lostpassword'”. How can I change the URL in order to have it at “mydomain.com/lostpassword”?
I changed the link using the lostpassword_url filter, but now I have to somehow display the default lost password page on the new custom link (it is currently showing "Page not found").
I am not trying to display a custom lost password page, but to display the default lost password page on a custom url.
Thanks for your help!
wp-login.php
isn't a permalink but a direct file URL, the WP rewrite rule system won't apply. Changing the URL WP thinks it's at won't be enough either as it'll just lead to a 404 if the original isn't somehow mapped or moved. If it's a redirect you're after though, then that becomes signifiicantly easier to answer. Otherwise it may be impossible without bulding a custom page that's a replica/login
and/admin
that redirect to the appropriate places. This also won't improve security