我的文件中有此代码,.htaccess可将用户路由到我的root/index.php文件
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
但是,这很好用:所以如果我要去localhost/MyFolder/Xyz,如果Xyz is not existing it takes me to localhost/index.php现在我想要的是,我有这样的文件夹,css js images所以我没有任何index.php文件,所以它列出了我的所有文件。我知道我可以在那里添加 index.php 文件,并且可以将用户重定向到我的根目录。但这是一项 TDS 工作。.htaccess如果找不到index.php它带我去index.php的任何文件夹,我有什么办法可以在任何文件夹中做某事localhost吗?
有没有办法。只是不想放入index.php每个文件夹来限制其访问。