1

first of all - sorry for my bad english. Im trying to change the Backend-URL from /wp-admin/ to /admin/ as example.

im using

define('WP_ADMIN_DIR', "admin");
define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . WP_ADMIN_DIR);

add_filter('site_url',  'wpadmin_filter', 10, 3);
function wpadmin_filter( $url, $path, $orig_scheme ) {
$old  = array( "/(wp-admin)/");
$admin_dir = WP_ADMIN_DIR;
$new  = array($admin_dir);
return preg_replace( $old, $new, $url, 1);
}

and for .htaccess

RewriteEngine on

RewriteRule ^admin/(.*) wp-admin/$1?%{QUERY_STRING} [L]

Well, this went fine for me two days ago. But since today its not working anymore.

Wordpress is logging me out after im going for xxxx.xx/admin/.

Cant even Login because of redirects(?). The Login-form is just resetting. j4i: i despair.. ive looked up any related thread on stackoverflow Thanks for any help or advice in advance,

Angelos

2 Answers2

1

well. i fixed it.

define('WP_ADMIN_DIR', "admin");
define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . WP_ADMIN_DIR);

this entry has to be in wp-config.php.

Ive wrote it in my plugin and obviously its not working.

thanks anyway <3

  • Note that it can't be just placed anywhere in the `wp-config.php`, but should be below the inclusion of `wp-settings.php` because `SITECOOKIEPATH` is set somehwere in there. – Ogier Schelvis Dec 07 '18 at 11:13
1

Add constant to wp-confing.php

define('WP_ADMIN_DIR', 'admin'); define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . WP_ADMIN_DIR);

Please see URL will help you.

[https://wordpress.org/support/topic/how-to-change-the-admin-url-or-wp-admin-to-secure-login/][1]

Dhara Patel
  • 355
  • 5
  • 7