.htaccess php删除子文件夹

.htaccess php删除子文件夹,php,.htaccess,url-rewriting,Php,.htaccess,Url Rewriting,当前使用 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] 但是,将使用此功能的php脚本移动到子文件夹,并在主目录中包含其他内容 允许上述操作仅在子文件夹中运行的最佳方法是什么?只需将文件与php文件一起移动到子文件夹中即可将.htaccess移动到同一子文件夹中。

当前使用

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
但是,将使用此功能的php脚本移动到子文件夹,并在主目录中包含其他内容


允许上述操作仅在子文件夹中运行的最佳方法是什么?

只需将文件与php文件一起移动到子文件夹中即可

将.htaccess移动到同一子文件夹中。