无法访问是因为道preSS我的文件夹我的、是因为、文件夹、无法访问

2023-09-02 00:55:06 作者:无关痛痒

我已经安装了的Word preSS上我的网站,我使用永久链接,但我有一个名为x在我的网站的主要根源,现在当我输入我无法访问文件夹 HTTP:// mywebsite / X 它重定向我错误404未找​​到。这是因为Word preSS试图誉称,名为x在数据库中的故事。我怎样才能排除文件夹及其子女从wrod preSS计算文件夹?

I have installed my WordPress on my website and I'm using permalinks, but I have a folder called x in the main root of my website I can't access it now when I type http://mywebsite/x it redirects me to error 404 not found. That's because WordPress is trying to fitch the story that called x in the database. How can I exclude that folder and its childern "folders" from wrodpress calculations?

推荐答案

在您的网站的根目录下的的.htaccess 文件包含一个重写规则,它把每一个进来的请求字preSS的引导程序。它可能看起来是这样的:

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]

您应该增加两个条件,以本规则。这些条件为例外确保只执行的规则,如果没有()的文件(-f )或者没有目录( -d )提供相匹配的请求的URL:

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]

这是应该做的伎俩。