静态和伪静态优先级的问题

百度好多,没有找到IIS配置解决的办法,先记录一下问题。

静态文件存在的情况下,直接访问静态文件,如果不存在,执行伪静态,路径和文件一样。

微软对这块的文档

参考了以下案例,没有搞定我自己的问题。


apache - What's the IIS equivalent of these rewrite rules? - Stack Overflow I've always used apache, so I'm completely new to IIS. How would I do this in IIS? RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,... https://stackoverflow.com/questions/4364197/whats-the-iis-equivalent-of-these-rewrite-rules

自己写个http Module实现了,判断文件不存在就生成,然后RewritePath
参考:

有帮助麻烦点个采纳【本回答右上角】,谢谢~~