PHP wordpress wp-admin重写

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP wordpress wp-admin重写相关的知识,希望对你有一定的参考价值。

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





copy past this code in wp-login.php put on very top most place
=====

session_start();
//See what file is being requested by the web client, also store the arguments just in case.
list($file,$arguments) = explode("?", $_SERVER['REQUEST_URI']);
//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))
{ session_destroy(); header("location: /"); }
 
//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.
elseif(stripos($file, 'wp-login') && !isset($_SESSION['valid_entrance']))
{  header("Location: /"); exit(); }
 
//If the user is requesting the right login entrance set the sentinel to true
elseif ($file == "/admin")
{  $_SESSION['valid_entrance'] = true; }

以上是关于PHP wordpress wp-admin重写的主要内容,如果未能解决你的问题,请参考以下文章

上传 Wordpress 图片:错误 Permission denied in ....wp-admin/includes/file.php

Wordpress 403/404 错误:您无权访问此服务器上的 /wp-admin/themes.php

PHP Wordpress阻止访问wp-admin - wpsnipp.com为您的博客提供Wordpress代码段

安装wordpress的时候点击 wp-admin/install.php 显示WordPress requires that your web server is running

安装wordpress,到wp-admin/install.php步,出现500错误,怎么办

为啥我不能在 Wordpress 中创建新帖子?警告:从第 716 行 /public_html/wp-admin/includes/post.php 中的空值创建默认对象