You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mike Rumph <mi...@oracle.com> on 2015/05/21 18:37:52 UTC
Re: [users@httpd]Does mod_maxmiddb take action after mod_rewrite?
Hello Rubén,
I added a subject line to your email to make it easier to track.
For questions related to mod_maxminddb, you are more likely to find help
on the MaxMind support page:
- https://www.maxmind.com/en/online-support-resources
- https://github.com/maxmind/mod_maxminddb
Thanks,
Mike Rumph
On 5/21/2015 1:42 AM, Rubén Toribio Aldeguer wrote:
> Hi
>
> we are working with a mod_maxminddb and apache 2.410.
>
> mod_maxminddb is configured to set de env variable GEOIP_COUNTRY_CODE
>
> The problem is that if we do:
>
> RequestHeader set GEOIP_COUNTRY_CODE %{GEOIP_COUNTRY_CODE}e
>
> We see correctly set the header. (is set to "ES", as we expected)
>
> But,in this rewrite rules, GEOIP_COUNTRY_CODE seems to don't be seted,
> and applies the alternative value "en" on the RewirteRule:
>
> RewriteMap locale-to-pub txt:conf/rewrites/locale_to_pub_b2c_v61.txt
> RewriteRule ^\/((index|home)(\.php|\.jsp))?$
> /${locale-to-pub:%{ENV:GEOIP_COUNTRY_CODE}|en}/home.jsp
> [R=301,NC,L,E=nocache:1]
>
> This are ERROR TRACES from rewrite_mod, where we can see "key=" as void.
>
> applying pattern '^\\/((index|home)(\\.php|\\.jsp))?$' to uri '/'
> cache lookup FAILED, forcing new map lookup
> map lookup FAILED: map=locale-to-pub[txt] key=
> rewrite '/' -> '/en/home.jsp'
>
>
> After some research, and tests, we know that if we force the variable whit
>
> SetEnIf GEOIP_COUNTRY_CODE=ES
>
> it works. It is because SetEnIf sets the variable at the begining of
> the request, before mod_rewrite take acction. In this way, seems like
> mod_maxmiddb is taking acction after mod_rewrite.
>
> How can we confirm it? How can we workaround it?
>
> --
>
> *Rubén Toribio Aldeguer*
> Técnico Sistemas DataCenter
> Informática Área Sistemas
> (+34) 971743030
> www.riu.com <http://www.riu.com> / www.riuplaza.com
> <http://www.riuplaza.com>
>
>
> Facebook <http://www.facebook.com/Riuhoteles> Twitter
> <http://twitter.com/#%21/RiuHoteles> Flickr
> <http://www.flickr.com/photos/riuhotels/collections/> Youtube
> <http://www.youtube.com/user/RiuHotelsandResorts> Google Plus
> <https://plus.google.com/102337793674910512804/posts>
>
> This e-mail and its attachments, if any, are confidential and may be
> legally privileged. If you have received it in error, you are on
> notice of this status. Please do not copy or use it for any other
> purpose or disclose its contents to any other person: to do so could
> be a breach of confidence. You may contact us at +34 971 74 30 30 or
> at sender's e-mail address.
>
> Facebook*Please, consider the environment before printing this email.*
> <http://www.riu.com/es/sostenibilidad/inicio.jsp>
>