我不能在自定义目录中添加我自己的index.php文件,Wordpress会'覆盖'它


I can't add my own index.php files in a custom directory, Wordpress keeps 'overriding' it

所以我有一个index.php文件,我想通过domain.com/custom/path/index.php访问它[我知道index.php不需要在那里,因为浏览器会自动抓取它,但为了这个问题,我想我只是输入它],

但是当我进入这个路径时,wordpress启动并显示默认的No Results Found The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.

它为什么这样做?我该怎么补救呢?

谢谢。

您需要在.htaccess文件中添加一个重写规则,类似于:

RewriteRule ^custom/path/.*$    -    [L]

[L]告诉服务器停止尝试在它之后重写URL