Tuesday, April 19, 2022

[SOLVED] Set Request header with incoming header attribute value in apache

Issue

I need to set Request header with value from incoming header attribute.

RequestHeader set remoteuserid "%{Y-REMOTE-USER}e"

This is my incoming request header

+5633:60eeead3:4|GET /url HTTP/1.1|y-remote-user:xyz||User-Agent:AHC/1.0|Connection:keep-alive|Accept:/

I need to set remoteuserid with the value of y-remote-user which is xyz.?

Tried to setup with setEnv option but didn't work


Solution

These tags will help.

SetEnvIf y-remote-user ".+" Y-REMOTE-USER=$0
RequestHeader set remoteuserid "%{Y-REMOTE-USER}e



Answered By - Sarath S
Answer Checked By - Timothy Miller (WPSolving Admin)