简体   繁体   English

htaccess,如果没有query_string

[英]htaccess if no query_string

Is it possible to have something like. 有可能有类似的东西。

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

I am trying to allow cache-busting across our dev environment if there is a query_string of no-cache=1 如果有一个no_cache = 1的query_string,我试图允许在我们的开发环境中进行缓存清除

You can use this code in your root .htaccess: 您可以在根.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]

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

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