繁体   English   中英

重写规则从正则表达式(。*)中排除某些字符串

[英]Rewrite Rule exclude certain strings from (.*) in Regex

我目前有以下htaccess重写规则:

RewriteRule    (.*) index.php/$1 [L]

如何排除2个特定字符串,例如“ template”和“ image”?

我读了其他帖子,但我不清楚。

您可以做出否定的重写条件

像这样:

RewriteCond %{REQUEST_URI} !^/(template|image)
RewriteRule (.*) index.php/$1 [L]

它实际上不会重写指向图像和模板文件夹中内容的所有url。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM