I would like to redirect example.com/wp-admin
to my index and make the WP-Admin accessible though something like example.com/admin
.
I did this in apache
but after switching to nginx I don’t know how to do this?.
Is there a way to do this without changing any of the wordpress files but changing the nginx config ?
Also need to access example.com/wp-admin/index.php
as example.com/admin/index.php
, example.com/wp-admin/posts.php
as example.com/admin/posts.php
etc..
In my opinion if you use plugin than it will find security holes in your WordPress.
You can use the following steps to create your own URL of login either admin or else as follows:
1.) Add constant to
wp-confing.php
2.) Add below filter to
functions.php
3.) Add below line to .htaccess file if you are using Apache
Edit the Nginx virtual host file and place the following:
Done…!!!
Now your admin URL will be like: http://www.yourdomain.com/secret-folder/
and the below code will restrict the URL: site.com/wp-admin
Edited:
Edit the Nginx virtual host file and place the following:
In case if you want to redirect url from index.php to back on admin
Another benefit from doing it this way is that
nginx
does a return faster than a rewrite.You mean to change the url of wp-admin. Then you can use a plugin mentioned below
WordPress Link
After installing the plugin Under settings->Permalink we can change WP-admin page slug to what we need.
For changing the admin url ,Try using the below plugin
https://wordpress.org/plugins/wordfence/