We all know that WordPress comes with a cool Permalink structure that you can easily customize under WordPress admin setting. But this only apply on post and page, what if you want to make a simple URL on your login page? This will be very useful to our authors, writers and site members. What if we create a new custom URL for our login like http://mywpsite.com/login instead of the default http://mywpsite.com/wp-login.php. Today i will show you how to create a custom URL for your WordPress login using a simple .htaccess code.
# BEGIN WordPress
RewriteEngine On
RewriteBase /
# BEGIN insert this RewriteRule
RewriteRule ^login$ http://mywpsite.com/wp-login.php [NC,L]
# END
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
You need to find first your .htaccess file located in your root folder of your WordPress folder, then locate the created .htaccess code by WordPress (if your using custom permalink) then add this:
Code right after RewriteBase / line then save it.
# BEGIN insert this RewriteRule
RewriteRule ^login$ http://mywpsite.com/wp-login.php [NC,L]
# END
You can also assign your own name if don’t like http://mywpsite.com/login, just change the ^login$ to what ever name you want. Note that this will not rename your or disable the old http://mywpsite.com/wp-login.php URL. This will just give another URL for it. If you really want to completely rename the http://mywpsite.com/wp-login.php, i recommend you read this great tutorial on how to rename wp-login.php with the use of add_filter function. If you have a much easier way to do it like plugin, please share it with us.