更新时间:2023-09-12 18:11:34
An alternative is to use content negotiation. Turn on multiviews:
Options +MultiViews
如果命名资源不存在,Apache 将搜索该文件,然后根据浏览器发送的媒体类型和内容编码要求进行排序.如果只有一个文件(您的 PHP 脚本),则 URL 将解析为该文件.
If a named resource doesn't exist, Apache will glob for the file, then sort based on the media type and content encoding requirements send by the browser. If there's only one file (your PHP script), then that's what the URL resolves to.