I need to set a param for a module
(specifically is activation of geoencoding module by setting a param GeoIPEnable On)
in httpd.conf based on a parameter in the request url (for example geo=true).
How can this be done?
The "good" way to do this would be the <If>
functionality in Apache 2.4.
Assuming that's not available, you're left with rather hackish workarounds. Assuming the content will be ok with this (this may break if you have dynamic content - can you expand on what's running within Apache?), you could do something along these lines:
RewriteEngine On
# Do an internal redirect of the requests that have the geoip=true param:
RewriteCond %{QUERY_STRING} geoip=true [NC]
RewriteRule ^(.*)$ /geoip$1 [PT,QSA,L]
# Make the content under /geoip identical to the docroot:
Alias /geoip /path/to/docroot
# And, configure /geoip for the GeoIP lookups:
<Location /geoip>
GeoIPEnable On
</Location>