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?
To answer you question as a apache URL layout configuration via mod_rewrite (the apache module that handles URL rewriting), this could be helpful:
(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:
You would need to replace the
domain/wp-admin/
part withdomain/admin/
with a filter on your own.hakre…. Great answer… now with the latest version of wordpress having a separate network admin I used your solution and added in the part to properly rewrite the “Network Admin” links in the same way…
In addition to the previous solutions. I found the missing css and script files.
the fix is