有没有办法通过 mod_rewrite
条件访问PHP自定义标头值。我的尝试是这样的:
$options = array(
'http' => array(
'proxy' => $proxy,
'request_fulluri' => True,
'header' => "MY_CUSTOM_HEADER: foo\n\r"
)
);
$context = stream_context_create($options);
$content = file_get_contents("http://$url", false, $context);
使用mod_rewrite条件如下所示:
RewriteCond %{HTTP:MY_CUSTOM_HEADER} ^foo$