wordpress Forbidden 您无权访问此服务器上的/wp-login.php

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15969527/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:12:49  来源:igfitidea点击:

Forbidden You don't have permission to access /wp-login.php on this server

wordpresspermissions

提问by user2274068

I have one problem with all my WordPress's sites. I can access in all and navigate in the posts, pages and other. But when I go to wp-login.phpI view the form and put user and password.

我的所有 WordPress 网站都有一个问题。我可以访问所有内容并在帖子、页面和其他内容中导航。但是当我去wp-login.php查看表单并输入用户名和密码时。

And when I clicking access goes here:

当我点击访问时:

Forbidden

You don't have permission to access /blog/wp-login.php on this server.

禁止的

您无权访问此服务器上的 /blog/wp-login.php。

I have permissions in folder 755and files 644, and I check all if i can, any help?

我在文件夹755和文件中拥有权限,644如果可以,我会检查所有内容,有什么帮助吗?

Thanks

谢谢

回答by SirPaul

The solution is to add this to the beginning of your .htaccess

解决方案是将其添加到 .htaccess 的开头

<Files wp-login.php>
Order Deny,Allow
Deny from all
Allow from all
</Files>

It's because many hosts were under attack, using the wordpress from their clients.

这是因为许多主机受到攻击,使用来自其客户的 wordpress。

回答by Steven Lambert

I had this same problem, and after temporarily deleting all my .htaccess files, then trying to modify them as suggested, and making sure all my files and folder permissions were set to 777, I still couldn't get it to work. I don't know why I couldn't access the file, but I was able to create a new file and access it no problem. So what I did was create a new file in /wp-admin/called temp.phpand pasted all the code from install.phpinto it. This allowed me to access the file. The only other thing I had to do was edit the code so that the form submitted to temp.php instead of install.php. After that, I could finish the install and everything worked.

我遇到了同样的问题,在暂时删除了我所有的 .htaccess 文件,然后尝试按照建议修改它们,并确保我的所有文件和文件夹权限都设置为 之后777,我仍然无法让它工作。我不知道为什么我无法访问该文件,但是我能够创建一个新文件并且访问它没有问题。所以我所做的是在/wp-admin/调用中创建一个新文件temp.php并将所有代码粘贴install.php到其中。这允许我访问该文件。我唯一要做的另一件事是编辑代码,以便将表单提交到 temp.php 而不是 install.php。之后,我可以完成安装并且一切正常。

<form id="setup" method="post" action="temp.php?step=2">

<form id="setup" method="post" action="temp.php?step=2">

回答by Mikeys4u

Make sure the following lines are not in your wp.config

确保以下几行不在您的 wp.config 中

define( 'FORCE_SSL_LOGIN', true );
define( 'FORCE_SSL_ADMIN', true );
define( 'DISALLOW_FILE_EDIT', true );

I got locked out after deactivating iThemes security plugin

停用 iThemes 安全插件后我被锁定了

回答by Mladen Janjetovic

Sometimes if you are using some simple login info like this: username: 'admin' and pass: 'admin', the hosting is seeing you as a potential Brute Force Attack through WP login file, and blocks you IP address or that particularly file.

有时,如果您使用一些简单的登录信息,例如:用户名:'admin' 和 pass:'admin',主机会将您视为通过 WP 登录文件进行的潜在暴力攻击,并阻止您的 IP 地址或该特定文件。

I had that issue with ixwebhosting and just got that info from their support guy.They must unban your IP in this situation. And you must change your WP admin login info to something more secure.

我在 ixwebhosting 上遇到了这个问题,只是从他们的支持人员那里得到了这些信息。在这种情况下,他们必须取消禁止您的 IP。并且您必须将您的 WP 管理员登录信息更改为更安全的信息。

That solved my problem.

那解决了我的问题。

回答by conradkleinespel

I had a similar error, which was fixed by adding:

我有一个类似的错误,这是通过添加修复的:

Options FollowSymLinks

... in the apps/[app-name]/conf/httpd-app.conffile. This is because, in my case, an .htaccessfile wants to use rewrite rules, that are not allowed with FollowSymLinks AND SymLinksIfOwnerMatch turned off.

...在apps/[app-name]/conf/httpd-app.conf文件中。这是因为,在我的情况下,.htaccess文件想要使用重写规则,而在 FollowSymLinks 和 SymLinksIfOwnerMatch 关闭时不允许使用这些规则。

If your conf file already has a line with Options ..., you can just add FollowSymLinksto the list of options. You could end up with something like this:

如果您的 conf 文件已经有一行Options ...,您可以添加FollowSymLinks到选项列表中。你可能会得到这样的结果:

Options Indexes MultiViews FollowSymLinks

回答by Jaycob Read

If you are using the iThemes Security plugin (former Better WP security) please refer to the answer provided by Mikeys4u.

如果您使用的是 iThemes Security 插件(以前的 Better WP security),请参考 Mikeys4u 提供的答案。

Also, there is a similar thread related to this plugin on the WordPress support: https://wordpress.org/support/topic/how-to-reset-ithemes-security-plugin-to-fix-issues

此外,在 WordPress 支持上有一个与此插件相关的类似线程:https: //wordpress.org/support/topic/how-to-reset-ithemes-security-plugin-to-fix-issues

Make sure you backup your database before trying any of the solutions.

在尝试任何解决方案之前,请确保备份数据库。

回答by Rahul Yadav

Change .htaccess file code by this code :

通过以下代码更改 .htaccess 文件代码:

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file= [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*)  [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$  [L]
RewriteRule . index.php [L]
# END WordPress

回答by Andy

Make sure your apache .conf files are correct -- then double check your .htaccess files. In this case, my .htaccess were incorrect! I removed some weird stuff no longer needed and it worked. Tada.

确保你的 apache .conf 文件是正确的——然后仔细检查你的 .htaccess 文件。在这种情况下,我的 .htaccess 不正确!我删除了一些不再需要的奇怪的东西并且它起作用了。多田。

回答by devilcrab

This should work :

这应该工作:

The instructions says that you add a separate .htaccess containing the lines above to the wp-admin folder - and leave the main .htaccess, in the root, alone.

说明说您将包含上述行的单独 .htaccess 添加到 wp-admin 文件夹 - 并将主 .htaccess 单独留在根目录中。

if that don't help , you can try this:

如果那没有帮助,你可以试试这个:

copy the .htaccess file as is from the wp-admin and placed it in the root folder and bingo! It should work ! if you face new error after this let us know.

从 wp-admin 原样复制 .htaccess 文件并将其放在根文件夹和宾果游戏中!它应该工作!如果您在此之后遇到新错误,请告诉我们。

for reference you can look here as well:

作为参考,您也可以在这里查看:

http://wordpress.org/support/topic/you-dont-have-permission-to-access-blogwp-loginphp-on-this-server

http://wordpress.org/support/topic/you-dont-have-permission-to-access-blogwp-loginphp-on-this-server

Check using this:

检查使用这个:

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>