Home >Backend Development >PHP Tutorial >php怎么拦截文件请求,比如http://localhost/test/test.rar

php怎么拦截文件请求,比如http://localhost/test/test.rar

WBOY
WBOYOriginal
2016-06-13 10:24:451327browse

php如何拦截文件请求,比如http://localhost/test/test.rar
有没有可能把这些请求拦截到一个php里,不用apache的转发 
  http://localhost/test/test.rar
  http://localhost/test/test.rar?aa=bb
求大神们指教

------解决方案--------------------
RewriteCond %{REQUEST_URI} ^.*.rar$
RewriteRule ^(.*)$ index.php?/$1 [L]

参照这规则,rewrite

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn