我的守则是:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond application/public/%{REQUEST_FILENAME} -f
RewriteRule (.*) application/public/$1 [L]
我要表达:
- If file
{REQUEST_FILENAME}
doesn t exist AND if fileapplication/public/%{REQUEST_FILENAME}
exists do rewrite
实例:
- /style.css = /application/public/style.css
- /gfx/logo.png = /application/public/gfx/logo.png
- /index.php = /index.php
- /Welcome = /index.php?input=Welcome (it s working)
这一表述有什么适当的准则? 我认为,需要改变思路:
RewriteCond application/public/%{REQUEST_FILENAME} -f
但是,我没有血腥的思维方式......
全面登录:
RewriteEngine on
RewriteRule style,(.+).css tmp/merged/css,$1 [L,QSA]
RewriteRule script,(.+).js tmp/merged/js,$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond application/public/%{REQUEST_FILENAME} -f
RewriteRule (.*) application/public/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) index.php?input=$1 [L,QSA]