RewriteRule ^admin$ http://example.com/wp-admin/ [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
- The dollar sign
$means “stop matching here” (So ultimately we’re looking for
- 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:
NCmeans “no case” which means “LoGiN” would match as well as “login”.
Lmeans “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
Rflag as well.