gpt4 book ai didi

regex - 重写规则从 Regex 中的 (.*) 中排除某些字符串

转载 作者:行者123 更新时间:2023-12-02 05:39:49 24 4
gpt4 key购买 nike

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

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

如何让它排除 2 个特定的字符串,例如:'template' 和 'image'?

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

最佳答案

你可以做一个否定的重写条件

像这样:

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

这实际上不会重写任何指向图像和模板文件夹中内容的 url。

关于regex - 重写规则从 Regex 中的 (.*) 中排除某些字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11172642/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com