Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer

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

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

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