Project

General

Profile

Actions

Bug #1895

closed

setenv.add-response-header not used in url.redirect

Added by amandato almost 16 years ago. Updated almost 16 years ago.

Status:
Invalid
Priority:
Normal
Category:
mod_redirect
Target version:
ASK QUESTIONS IN Forums:

Description

I added a header using setenv.add-response-header but it was not included in the url.redirect. The header in question should be present in all url.redirects that occur within my condition where I placed the setenv.add-response-header.


Related issues 1 (0 open1 closed)

Related to Feature #2946: modules.conf order unhelpful (setenv vs. redirect)Fixed2019-04-10Actions
Actions #1

Updated by stbuehler almost 16 years ago

  • Status changed from New to Invalid

You must load mod_setenv before mod_redirect.

Actions #2

Updated by amandato almost 16 years ago

  • Status changed from Invalid to Reopened

I just triple checked, "mod_setenv" is included in the server.modules settings and the following settings are setup for my server:

$HTTP["host"] =~ "angelomandato\.com$" {
setenv.add-response-header = ("X-Meaning-Of-Life"=>"42")
url.redirect = ( "^(.*)" => "http://angelo.mandato.com$0" )
}

When you go to angelomandato.com, one of the headers included in the redirect should be X-Meaning-Of-Life: 42 and it is not included. I'm using the Firefox Live HTTP Headers plugin. for my particular solution, I've added the following line just above the line with con->http_status = 301;

response_header_insert(srv, con, CONST_STR_LEN("My_Header_Title"), CONST_STR_LEN("My_Header_Value"));

It would be nice if this feature actually worked for redirects. I've also submitted a ticket to add 302 redirect option for Lighttpd 1.4.x branch but it was rejected. I would like the option reconsidered because 1.5.x series is classified as beta for many linux distributions which means if I want Lighttpd 1.5.x I have to compile it myself on all the servers I manage.

Actions #3

Updated by icy almost 16 years ago

  • Status changed from Reopened to Need Feedback

Did you actually try what stbuehler said and put mod_setenv before mod_redirect in the modules list?

Actions #4

Updated by amandato almost 16 years ago

Yes. I am using the lighttpd.conf from the distro which loads setenv near the top of the structure. The redirect module is near the bottom. I take it your copy works or are you just assuming that it should work?

Actions #5

Updated by icy almost 16 years ago

stbuehler tested it and it worked. Maybe you are using an old version which had a bug since you are using your distros package?

Actions #6

Updated by amandato almost 16 years ago

oh, i'll chech that i have the latest version and see what happens.

Actions #7

Updated by amandato almost 16 years ago

Okay, running 1.4.20 and the redirect + header is working correctly now. Sorry for wasting your time. Looking forward to 1.5.x coming out of beta so it's included in most all distros then I will no longer have to recompile with the redirect set to 302 cause I can set the setting in 1.5. :-)

Actions #8

Updated by icy almost 16 years ago

  • Status changed from Need Feedback to Invalid
Actions #9

Updated by gstrauss over 5 years ago

  • Related to Feature #2946: modules.conf order unhelpful (setenv vs. redirect) added
Actions

Also available in: Atom