1

I've successfully changed the login page to a custom url, using this codes:

This one into wp-config.php

define('WP_ADMIN_DIR', 'secret-folder');
define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . WP_ADMIN_DIR);

This one into functions.php

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); }

This one .htaccess

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

Now i'm able to login throught /secret-folder/, but i'm still able to login throught both wp-login.php and wp-admin.

I can i redirect those pages to a 404 page?

1 Answer 1

0

Untested with your code but assuming it will be automated bots hitting your login pages you should get them straight off your site with something like this:

RedirectMatch 301 wp-login.php http://www.google.com RedirectMatch 301 wp-admin http://www.google.com

Not the answer you're looking for? Browse other questions tagged or ask your own question.