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

WBOY
Release: 2016-06-13 13:29:55
Original
1590 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template