.htaccess规则在我的网站中出错

.htaccess规则在我的网站中出错,.htaccess,.htaccess,我正在本地主机中使用以下.htaccess规则: .htaccess文件: ErrorDocument 404 /not-found RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php [NC,L] AddHandler cgi-script .php .php3 .php4 .phtml .pl .py .js

我正在本地主机中使用以下
.htaccess
规则:

.htaccess文件:

ErrorDocument 404 /not-found
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [NC,L]

AddHandler cgi-script .php .php3 .php4 .phtml .pl .py .jsp .asp .htm .shtml .sh .cgi
Options -ExecCGI
因此,url显示如下内容:

www.mysite.com/about

现在,当我使用
.htaccess
文件将所有文件上载到我的网址时,会显示以下错误消息:

Forbidden

You don't have permission to access /team-building.php on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
如何解决此错误,您会发现我正在使用
.htaccess
文件中的未找到错误文档规则。但是如果url错误,它不会显示错误消息页面

注意:出于测试目的,我使用子域:

子域:
所有当前文件都在
public\u html/demo/
文件夹中。

@anubhava该文件在我正在工作的demo文件夹中。@arkascha应该是什么?对不起,我删除了我的评论,这是错误的。在阅读你的代码时,我没有给予足够的注意。抱歉。@anubhava我测试了它,但显示了403错误消息。首先,我必须解决403错误消息,然后使用您给定的测试url检查它。非常感谢@anubhava:)