如果 URI 不以此开头,则重写条件包罗万象 [英] Rewrite condition catchall if the URI doesn't start with this
本文介绍了如果 URI 不以此开头,则重写条件包罗万象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我在我的 .htaccess 文件底部有这个重写条件作为一个包罗万象的.效果很好,但我希望它忽略任何请求并以/index.cfm"开头
So I have this rewrite condition at the bottom of my .htaccess file as a catchall. works great, but I want it to ignore any requests and begin with "/index.cfm"
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.+) /index.cfm?event=baduri&uri=$1
所以/index.cfm?fddssds 不会被触及
so /index.cfm?fddssds would not be touched
但是/gdfgdfgdfdgf 会被重定向..
but /gdfgdfgdfdgf would be redirected..
推荐答案
你可以试试这个并告诉我:
Can you try this and let me know:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/index.cfm
RewriteRule (.+) /index.cfm?event=baduri&uri=$1 [L,NC]
这篇关于如果 URI 不以此开头,则重写条件包罗万象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文