'Wordpress disable /admin redirect to /wp-admin

I have my website built with wordpress 4.5.2.

For wordpress contro panel, it it normal to login with myweb.com/wp-admin directory. But I have another control panel with other application in the directory myweb.com/admin.

The problem is whenever I try to login to myweb.com/admin it redirects to myweb.com/wp-admin

How to disable it?



Solution 1:[1]

You should cancel the default shortcuts in function.php :

remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );

From the docs:

wp_redirect_admin_locations():

If a user visits example.com/admin, they’ll be redirected to /wp-admin. Visiting /login redirects to /wp-login.php, and so on.

Solution 2:[2]

Can you please add below code in your functions.php

remove_action('template_redirect', 'redirect_canonical');

I hope this solution is work for you

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 David Wolf
Solution 2 Purvik Dhorajiya