由于 WordPress 无法访问我的文件夹

发布于 2024-10-04 13:32:21 字数 1459 浏览 0 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

春夜浅 2024-10-11 13:32:21

网站根目录中的 .htaccess 文件包含一个 RewriteRule,它将每个传入请求重定向到 Wordpress 的引导程序。它可能看起来像这样:

RewriteRule ^(.+)$ index.php?$1 [QSA,L]

您应该向此规则添加两个条件。这些条件提供了例外情况,确保仅在没有 (!) 文件 (-f) 或没有目录 (-d) 时才执行规则>) 与所请求的 URL 匹配的可用:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?$1 [QSA,L]

这应该可以解决问题。

The .htaccess file in the root of your website's directory contains a RewriteRule which redirects every incoming request to Wordpress's bootstrapper. It probably looks something like this:

RewriteRule ^(.+)$ index.php?$1 [QSA,L]

You should add two Conditions to this Rule. These conditions provide exceptions that make sure the Rule is only executed if there is no (!) file (-f) or no directory (-d) available that matches the requested URL:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?$1 [QSA,L]

That should do the trick.

陌上芳菲 2024-10-11 13:32:21

检查 .htaccess 文件,这可能是个问题。 (如果页面不存在,则重定向,在您的情况下, http://mywebsite/x/index.html或 .php 不存在)

check .htaccess file, that could be a problem. (redirection if page does not exist, in your case, http://mywebsite/x/index.html or .php does not exist)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文