The default URL for logging into your WordPress powered site is:
http://yoursite.com/wp-login.php. Or if you’ve installed in a subdirectory, something like
http://yoursite.com/wordpress/wp-login.php. I’ve wished that was a little cleaner, especially when you are doing something explaining to a client where to log in over the phone. Fortunately changing this can be very easy.
To make your login URL just
http://yoursite.com/login just add this line in your .htaccess file before the default WordPress rewrite stuff:
RewriteRule ^login$ http://yoursite.com/wp-login.php [NC,L]
- The carret (^) is a substitute for the directory that the .htaccess file is in. For example if the file is in your root, it stands for http://yoursite.com/
- The $ means “stop matching here” (So ultimately we’re looking for http://yoursite.com/login)
- Then after the space you put the URL to use instead. This is our fully valid WordPress login URL, nothing fancy here
- After that are the [flags]. We are using two: NC and L. NC means “no case” which means “LoGiN” would match as well as “login”. L means “last” meaning don’t process any of the rest of the .htaccess file after this match. This is important so our WordPress rewrites don’t get involved.
- Note that this doesn’t redirect, it rewrites, which I think is cleaner. If you’d prefer a redirect, you can add an “R” flag as well.
Not up for tinkering with .htaccess yourself? Ozh has a plugin based on this post.