隐藏可湿性粉剂管理员和WP-login.php中的的.htaccess可湿性、粉剂、管理员、WP

2023-09-02 11:43:24 作者:不懂烦人。

我在我的.htaccess文件如下

I have the following in my .htaccess file

        RewriteRule ^(/)?access/?$ /wp-login.php [QSA,L]
        RewriteRule ^(/)?register/?$ /wplogin?action=register [QSA,L]
        RewriteRule ^wp-admin$ http://www.mywebsite.com/404.php [R=301,L]
        RewriteRule ^wp-login.php$ http://www.mywebsite.com/404.php [R=301,L]

现在的问题是我取得的成就,我想......这是用户没有看到可怕的WP-login.php中............在浏览器中也出于安全原因,我想隐藏可湿性粉剂管理员。

The problem is i achieved what i wanted...which is users not seeing the hideous "wp-login.php ............" in the browser also for security reasons i wanted to hide wp-admin.

但是,什么情况是,底部覆盖规则在什么上面......一旦我删除$ C $的最后两行的注释c中的登录按钮转到404页。我知道这是可能实现我想要什么,因为的iThemes做到了与他们的插件,但因为有它,我的主题兼容性问题,我必须停止使用,但我想要的功能,以保持藏可湿性粉剂管理员和WP -login.php没有preventing www.mywebsite.com/access和www.mywebsite.com/register无法正常工作。

But what happens is that the bottom rules overwrite whats at the top...once i remove the comments from the two last lines of code the login buttons go to the 404 page. I know it is possible to achieve what i want because ithemes did it with their plugin but because there are compatibility issues with it and my theme i have to stop using it but i want the feature to keep hiding "wp-admin" and "wp-login.php" without preventing www.mywebsite.com/access and www.mywebsite.com/register from working.

关于

推荐答案

试着用替换那些2的规则:

Try replacing those 2 rules with:

RewriteCond %{THE_REQUEST}  /+wp-(admin|login)
RewriteRule ^ /404.php [L,R=404]

如果你匹配的%{THE_REQUEST} 变量,你只是在什么浏览器所请求相匹配的,而不是一直在内部改写。

If you match against the %{THE_REQUEST} variable, you'll match only what the browser requested, not what's been internally rewritten.