更新时间:2023-02-23 12:41:59
您不需要任何规则.只需确保该目录的.php
默认索引文件即可自动完成.
You don't need any rule for it. Just make sure that .php
default index files for the directory and it'll happen automatically.
更新
我认为您的规则
^([a-zA-Z0-9_-]+)?$ $1.php
实际上应该是
^([a-zA-Z0-9_-]+)$ $1.php
,以使其与未提供文件名的请求不冲突(您希望将其定向到index.php
).
so that it does not conflict with requests where the filename isn't given (which you want to direct to index.php
).