【发布时间】:2022-02-06 17:43:04
【问题描述】:
实际的.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule index.php [L]
目标: 所有文件都应该指向 index.php 还有 png/xml 等。
在浏览器上调用: http://localhost:8080/test.png
浏览器消息: enter image description here
日志:
[Sun Feb 6 01:23:29 2022] [::1]:57052 Accepted
[Sun Feb 6 01:23:29 2022] [::1]:57052 [404]: GET /test.png - No such file or directory
[Sun Feb 6 01:23:29 2022] [::1]:57052 Closing
我的服务器开始测试:
php -S localhost:8080 -dxdebug.mode=debug -dxdebug.client_host=127.0.0.1 -dxdebug.client_port=9003 -dxdebug.start_with_request=yes
我的实际服务器:
PHP 8.1.1 (cli) (built: Dec 17 2021 22:38:05) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.1, Copyright (c) Zend Technologies
with Xdebug v3.1.2, Copyright (c) 2002-2021, by Derick Rethans
with Zend OPcache v8.1.1, Copyright (c), by Zend Technologies
适用于 macbook ...
有想法解决我的问题吗?
【问题讨论】: