WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm struggling with getting a few things in WP to redirect.

I'm using a front-end profile / profile editor, and I'm also using a front-end login/register. Naturally I would like to redirect the standard wp-login.php URLS to specific ones.

Mainly :

http://www.mysite.com/wp-login.php?action=lostpassword => http://www.mysite.com/login/forgot/

http://www.mysite.com/wp-login.php?action=register => http://www.mysite.com/register/

http://www.mysite.com/wp-login.php , http://www.mysite.com/wp-login.php?action={anything} , etc => http://www.mysite.com/login/

I've tried to use RewriteRule's in my .htaccess file, namely :

RewriteRule ^login$ http://yoursite.com/wp-login.php [NC,L]

to test out rewrites, and nothing happened.

I have also been somewhat unsuccessful with add_rewrite_rule()

If anyone could point me towards the right direction, it would be much appreciated!

Thanks, Tre

share|improve this question
Can you post more of your .htaccess file? – Kyle Feb 7 '12 at 22:21
You can't do http://www.mysite.com/wp-login.php?action={anything} => http://www.mysite.com/login/, i.e. rewrite many addresses to only one. Your question lacks of precision. – Olivier Pons Mar 23 '12 at 9:10
Can you also post add_rewrite_rule() code? – Mamaduka Mar 23 '12 at 9:22
up vote 1 down vote accepted

Ozh has a great tutorial about pretty login URLs, that you might find helpful - Pretty Login URL: a Simple Rewrite API Plugin Example

share|improve this answer

protected by toscho Jun 16 '12 at 6:52

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.