Home Articles An easy to remember login address

An easy to remember login address

4729
12
SHARE

Sometimes I find it pretty hard to type my WordPress Admin URL… you know “http://blogaddress.com/wp-admin.php” or “http://blogaddress.com/wp-admin/“… that’s too many dashes, points and slashes for my taste :-D.

If your server supports mod_rewrite (most servers do), you can shorten your login URL to just “login” by adding this rewrite directive to the .htaccess file in your blog directory:


RewriteEngine On
RewriteBase /
RewriteRule ^login$ /wp-login.php [L]

But wait, if your blog’s permalink structure is set to “pretty” permalinks, then, your .htaccess file has some rewrite rules already, in that case just add the RewriteRule directive right after the “RewriteBase /”. Like this:


RewriteEngine On
RewriteBase /

RewriteRule ^login$ /wp-login.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Make sure you save a back-up copy of the original .htaccess file (if there was one) before making these changes. You can never be too careful.

Also, make sure there isn’t a “login” directory.

12 COMMENTS

  1. This is AWESOME — thank you so much.

    One question: how do you mask the URL when someone logs out? It seems like the addition of the ?loggedout=true breaks the rewrite rule…

Comments are closed.