解决方案
RewriteRule ^(static|onitroad).* - [NC,L] # all other requests will be forwarded to Cake RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/ [L]
如果是static 或者 onitroad 目录,则不重定向(‘-’)。
[NC]的意思是不区分大小写。
[L]的意思是"在这里停止重写过程,并且不再应用任何重写规则。"
在htaccess中,如何设置规则,不对某些URL进行重定向?
比如:
/appRoot/.htaccess app/ static/
现在的重写规则是
RewriteBase /appRoot RewriteRule ^$app/webroot/ [L] RewriteRule (.*) app/webroot/ [L]
默认情况下,对/appRoot/*的每个请求都将被重写。
如果我想排除 static,不进行重定向,该怎么写规则。
日期:2020-03-24 13:55:30 来源:oir作者:oir