Project

General

Profile

Bug #1895

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

Added by amandato over 10 years ago. Updated over 10 years ago.

Status:
Invalid
Priority:
Normal
Assignee:
-
Category:
mod_redirect
Target version:
Start date:
2009-02-11
Due date:
% Done:

0%

Estimated time:
Missing in 1.5.x:

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

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

Actions

History

#1

Updated by stbuehler over 10 years ago

  • Status changed from New to Invalid

You must load mod_setenv before mod_redirect.

#2

Updated by amandato over 10 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.

#3

Updated by icy over 10 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?

#4

Updated by amandato over 10 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?

#5

Updated by icy over 10 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?

#6

Updated by amandato over 10 years ago

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

#7

Updated by amandato over 10 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. :-)

#8

Updated by icy over 10 years ago

  • Status changed from Need Feedback to Invalid
#9

Updated by gstrauss 5 months ago

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

Also available in: Atom