setenvif

How to use SetEnvIf with Request_URI when it is rewritten to index.php?

天大地大妈咪最大 提交于 2020-06-27 17:24:09
问题 We have a drupal website a.com that is password protected. I want all a.com/api/... URIs not to be, though. So I've read about SetEnvIf : AuthName "Stage" AuthType Basic AuthUserFile ~/.htpasswd SetEnvIf Request_URI ".*data_sheets.*\.pdf" noauth SetEnvIf Request_URI "/api/.+" noauth SetEnvIfNoCase Request_Method OPTIONS noauth Order Deny,Allow Deny from all Require valid-user Allow from env=noauth Satisfy Any The /api/foobar URIs are still asking for a password though. Since it's a Drupal

How do I disable GZip with SetEnvIfNoCase in Apache .htaccess?

谁都会走 提交于 2020-01-25 12:03:38
问题 I want to disable GZip for certain pages. I have this in my .htaccess , but it still turns GZip on ( Content-Encoding: gzip ) when visiting dashboard/index . <ifmodule mod_deflate.c> AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html SetEnvIfNoCase Request_URI /dashboard/index no-gzip

How do I disable GZip with SetEnvIfNoCase in Apache .htaccess?

安稳与你 提交于 2020-01-25 12:02:45
问题 I want to disable GZip for certain pages. I have this in my .htaccess , but it still turns GZip on ( Content-Encoding: gzip ) when visiting dashboard/index . <ifmodule mod_deflate.c> AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html SetEnvIfNoCase Request_URI /dashboard/index no-gzip

Deny access to URI

只谈情不闲聊 提交于 2020-01-05 09:36:17
问题 I'm trying to deny access to a certain uri, namely /admin/ and have tried this .htaccess file: SetEnvIf Request_URI !^/admin/ not_admin_uri Order deny,allow Deny from all allow from 356.244.33. allow from env=not_admin_uri This works for the example IP range, but not for the "not_admin_uri" part. What's going wrong here? 回答1: To negate a match you cannot place ! in the SetEnvIf directive. You need to use negative lookahead like this: SetEnvIf Request_URI ^/(?!admin/) not_admin_uri 回答2: Maybe

Use SetEnvIf To Change A Variable Based Upon SSL_CLIENT_M_SERIAL Value

泄露秘密 提交于 2019-12-10 11:06:08
问题 Webserver in question is... /usr/sbin/apache2 -v Server version: Apache/2.4.7 (Ubuntu) Server built: Mar 10 2015 13:05:59 Portions of httpd.x.conf file... SSLVerifyClient optional SSLVerifyDepth 3 SSLOptions +StdEnvVars +ExportCertData SetEnvIf SSL_CLIENT_M_SERIAL "5174EAF60000000014E5" JK_REMOTE_USER=Rest But the result of that in the mod_jk.log is... [date and time junk] [debug] init_ws_service::mod_jk.c (1097): Service protocol=HTTP/1.1 method=GET ssl=true host=(null) addr=10.2.0.85 name

Use SetEnvIf To Change A Variable Based Upon SSL_CLIENT_M_SERIAL Value

情到浓时终转凉″ 提交于 2019-12-06 11:46:50
Webserver in question is... /usr/sbin/apache2 -v Server version: Apache/2.4.7 (Ubuntu) Server built: Mar 10 2015 13:05:59 Portions of httpd.x.conf file... SSLVerifyClient optional SSLVerifyDepth 3 SSLOptions +StdEnvVars +ExportCertData SetEnvIf SSL_CLIENT_M_SERIAL "5174EAF60000000014E5" JK_REMOTE_USER=Rest But the result of that in the mod_jk.log is... [date and time junk] [debug] init_ws_service::mod_jk.c (1097): Service protocol=HTTP/1.1 method=GET ssl=true host=(null) addr=10.2.0.85 name=local.apiclient.com port=443 auth=(null) user=(null) laddr=10.2.1.173 raddr=10.2.0.85 uri=/the/thing/i