本文介绍了将标头读入Apache 2.2中的环境变量吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用自定义重写映射处理请求标头.

I want to process a request header using a custom rewrite map.

因此,我想将标头的内容包含在环境变量中.

Therefore I want to have the content of the header in an environment variable.

我还没有找到使用mod_headers和/或mod_rewrite的方法.

I have not found a way to do that with mod_headers and/or mod_rewrite.

需要任何帮助.

推荐答案

请求标头"X-Forwarded-For"的Mod_rewrite示例:

Mod_rewrite example for the request header "X-Forwarded-For":

RewriteRule.*-[E = X-Forwarded-For:%{HTTP:X-Forwarded-For}]

RewriteRule .* - [E=X-Forwarded-For:%{HTTP:X-Forwarded-For}]

这篇关于将标头读入Apache 2.2中的环境变量吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 19:46