Is there any simple way to have wordpress, php or apache rewrite all urls which involve /wp-admin
to /admin
?
I have added this entry to my .htaccess file:
RewriteRule ^admin /wp-login.php [L]
However although domain.com/admin
will correctly show the login page all pages after you login show the URL as /wp-admin
which I want to always show /admin
.
Any thoughts on this?
3 s
To answer you question as a apache URL layout configuration via mod_rewrite (the apache module that handles URL rewriting), this could be helpful:
RewriteRule ^admin/(.*)$ /wp-admin/$1 [QSA,L]
(untested configuration directive, check the docs in case this does errors)
This will basically translate any request to /admin/… into /wp-admin/… .
If that’s the only thing you would like to know, I must admit that this is slightly off-topic for worpdress@se as this is acutally a question how to configure the apache webserver. A better place might be serverfault.
Keep in mind that this only rewrites the URLs that get requested. WordPress would know nothing about this and it does still output links to /wp-admin/ on the admin then. There is a hook for any admin URL that you might want to rewrite then as well:
return apply_filters('admin_url', $url, $path, $blog_id);
You would need to replace the domain/wp-admin/
part with domain/admin/
with a filter on your own.