Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache RewriteCond执行curl并匹配返回的字符串模式_Apache_Mod Rewrite_Curl_Httpd.conf - Fatal编程技术网

Apache RewriteCond执行curl并匹配返回的字符串模式

Apache RewriteCond执行curl并匹配返回的字符串模式,apache,mod-rewrite,curl,httpd.conf,Apache,Mod Rewrite,Curl,Httpd.conf,我在cookie中有一个令牌,我想在重定向之前验证它。 验证可以使用curl调用完成。如下图所示 在我的httpd.conf文件的Virtualhost标记下,我有这个 RewriteEngine on RewriteCond curl --request POST --header "X-My-Token:MGNhZTdkMzAtMzk4Yi00NTdlLWI5NmItMGVhYWZhNjM0NGNi" http://myhost.com:8888/saml-idp/api/validate-

我在cookie中有一个令牌,我想在重定向之前验证它。 验证可以使用curl调用完成。如下图所示

在我的httpd.conf文件的Virtualhost标记下,我有这个

RewriteEngine on
RewriteCond curl --request POST --header "X-My-Token:MGNhZTdkMzAtMzk4Yi00NTdlLWI5NmItMGVhYWZhNjM0NGNi" http://myhost.com:8888/saml-idp/api/validate-token !^.*"valid":true.*$ [NC]
RewriteRule .* http://SuccessURL.com
它为我提供了重写条件:错误的标志分隔符

我知道RewriteCond的语法不能这样


请建议我如何执行此curl调用,并在重定向之前检查返回的响应。

虽然这可能是可行的(使用),但实际上,不要这样做。编写一个简单的php(或其他)脚本

您有
prg:
示例,但请先阅读注释:)