【问题标题】:htaccess if no query_stringhtaccess 如果没有 query_string
【发布时间】:2015-01-13 01:18:09
【问题描述】:

有没有可能有类似的东西。

IF ! ${QUERY_STRING} no-cache=1
<load mod_gzip>
END IF

如果存在 no-cache=1 的 query_string,我正在尝试允许在我们的开发环境中清除缓存

【问题讨论】:

标签: apache .htaccess query-string


【解决方案1】:

您可以在根 .htaccess 中使用此代码:

# enable compression for all requests
SetOutputFilter DEFLATE

RewriteEngine On

# disable gzip compression is ?no-cache=1 is set in URL
RewriteCond %{QUERY_STRING} ^no-cache=1$ [NC]
RewriteRule ^ - [L,E=no-gzip:1,E=dont-vary:1]

【讨论】:

    猜你喜欢
    • 2011-11-06
    • 2017-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-29
    • 2014-10-21
    • 1970-01-01
    • 2022-01-04
    相关资源
    最近更新 更多