/ Published in: PHP
wp-admin rewrite to admin see artical http://www.michiknows.com/2007/02/12/who-else-wants-to-hide-their-wordpress-admin-folder/
Expand |
Embed | Plain Text
change secure-login to your desire url to call secure-login change in wp-login.php as well on your top most code .htaccess file rules ================== # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On #RewriteBase / #RewriteRule ^secure-login$ wp-login.php [L,NC,QSA] RewriteRule ^admin$ wp-login.php [L,NC,QSA] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ./index.php [L] </IfModule> # END WordPress ===== //See what file is being requested by the web client, also store the arguments just in case. //if the user just logged out, destroy this session and redirect them to root if("/wp-login.php?loggedout=true" == $file ."?" .$arguments || "action=logout" == substr($arguments, 0, 13)) //If our sentinel variable is set and true do nothing, allow normal script execution if(isset($_SESSION['valid_entrance']) && $_SESSION['valid_entrance'] == true) { /* As they say, "Silence is golden" */ } //Now if the user is requesting wp-login.php and our sentinel is not true, redirect the "attacker" to root. //If the user is requesting the right login entrance set the sentinel to true elseif ($file == "/admin") { $_SESSION['valid_entrance'] = true; }
You need to login to post a comment.
