我在 index.php 中有一个调度程序函数,因此 URL 如下:
/博客/节目转到
/index.php/blog/show
<IfModule mod_rewrite.c>
重写引擎开启
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
如何修改它,以便我可以将所有静态文件转储到公共目录中,但在 URL 中不公开的情况下访问它们。
例如 /docs/lolcats.pdf 访问
/public/docs/lolcats.pdf 在驱动器上
我试过这个
RewriteCond %{REQUEST_FILENAME} !f
RewriteRule ^(.*)$ public/$1 [QSA,L]