摘自我的.htaccess:
RewriteRule ^([0-9]+)x([0-9]+)$ images/$1x$2.png
# front controller
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(pdf|js|ico|gif|jpg|css|rar|zip|tar\.gz)$ index.php [L]
我想要实现的目标:当用户转到URL example.com/200x100
时,我想在内部将URL重写为example.com/images/200x100.png
,因此应用程序(前端控制器)将REQUEST_URI视为/images/200x100.png
},而不仅仅是200x100
。如果文件/images/200x100.png存在,则根本不应启动应用程序。