如果URI不以此开头,则重写条件catchall

Jef*_*ick 13 regex apache mod-rewrite

所以我在.htaccess文件的底部有这个重写条件作为一个catchall.效果很好,但我希望它忽略任何请求,并以"/index.cfm"开头

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule (.+) /index.cfm?event=baduri&uri=$1 
Run Code Online (Sandbox Code Playgroud)

所以/index.cfm?fddssds不会被触及

但/ gdfgdfgdfdgf将被重定向..

Boo*_*eus 17

你可以尝试这个让我知道:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/index.cfm
RewriteRule (.+) /index.cfm?event=baduri&uri=$1 [L,NC]
Run Code Online (Sandbox Code Playgroud)