WP-Mix

A fresh mix of code snippets and tutorials

Shortcut to WP Login

Back in January of 2011, Chris Coyier posted a sweet .htaccess technique for setting up Simpler Login URLs in WordPress. This is a follow-up technique that’s slightly improved..

First, here’s the code to add to your site’s root .htaccess file:

RedirectMatch 301 \@admin http://example.com/wp-admin/

Replace example.com with the path to your WP admin directory. For example, if WordPress is installed in a subdirectory named /wp/, the code should look like this:

RedirectMatch 301 \@admin http://example.com/wp/wp-admin/

Once in place, the WP login page will be accessible by appending @admin to literally any URL on your site. For example:

http://example.com/blog/august/@admin
http://example.com/2012/12/12/amazing-post/@admin
http://example.com/category/whatever/@admin

..and so forth. This can be especially keen when handing clients their login credentials for a new site, where the login page is always with quick reach while visiting the site.

Note that this technique sends a “301” response for the redirect, which means that the redirect is permanent. If you’d like to try the technique or just keep it temporary for awhile, use “302” instead.

Learn more

Digging Into WordPressWordPress Themes In DepthWizard’s SQL Recipes for WordPress