I want to change wp-admin to admin_panel using .htaccess file and when visit link admin_panel, it displays the contents of wp-admin, but when visit link wp-admin, it will notice not found
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /cms/wp/
RewriteRule ^index.php$ - [L]
RewriteRule ^admin_panel/(.*) /cms/wp/wp-admin/$1 [QSA,L]
RewriteRule ^wp-admin /cms/wp/nothing_404_404 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /cms/wp/index.php [L]
</IfModule>
# END WordPress
It not working, all url wp-admin or admin_panel result not found both.
I have no idea why you are trying to accomplish this only using .htaccess file but let me show you the correct way to change the admin directory.
If there is a specific reason why you want it to be done only using .htaccess file please let me know however I am not even sure if it is possible.
Steps:
Add constant to
wp-confing.php
Add below filter to functions.php
Add below line to .htaccess file
And you are done.
Now your admin URL will be like: http://www.yourdomain.com/admin_panel/
Hope this help.