سؤال

I'm try to redirect a illegal access and bring user to a log-in page, if user get permission and continue to access original, I need to keeping original request url. I try to write original url into http header zone, but I cannot retrieve this data from client.

Did apache2 or other module ignore custom http heaer? or I just miss something?

(BTW: I dont like use querystring, think about maybe next page still come as a redirection)

code example:

ap_set_content_type(r, "text/html");
apr_table_add(r->headers_out, "Location", conf->authurl);
apr_table_add(r->headers_out, "RequestUrl", url);

return HTTP_MOVED_TEMPORARILY;
هل كانت مفيدة؟

المحلول

// following code will be work fine. apr_table_add(r->err_headers_out, "RequestUrl", url);

see as: https://source.jasig.org/cas-clients/mod_auth_cas/tags/mod_auth_cas-1.0.9.1/src/mod_auth_cas.c

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top