SLNKY
SLNKY

Reputation: 21

Wordpress - Change Admin / Login URL

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

Upvotes: 1

Views: 6602

Answers (2)

Dhara Talaviya
Dhara Talaviya

Reputation: 631

Add constant to wp-config.php

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

The following URL provides more info:

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

Upvotes: 1

SLNKY
SLNKY

Reputation: 21

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

Upvotes: 1

Related Questions