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

WBOY
Release: 2016-06-13 10:24:45
Original
1258 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
Latest Issues
Why is "this" defined as undefined in Vue 3 function Please look at the following simple component example in Vue3: