1
votes

How To Get a Variable Inside IfModule?

I want Apache to replace *%{HTTP_HOST}*.... can that be done within an IfModule tag?

I am trying to setup Mod_Pagespeed in my .htaccess to work across multiple domains. This .htaccess file will be running on, dev, staging and production servers... each with a different cname (sub domain). We are on apache 2.2, so we cannot run an IfElse statement.

<IfModule pagespeed_module>
  ModPagespeed on

  ModPagespeedDomain *.example.com
  ModPagespeedDomain localhost

  ModPagespeedEnableFilters rewrite_domains
  ModPagespeedMapRewriteDomain %{HTTP_HOST} images.example.com

</IfModule>
1

1 Answers

0
votes

I think that Apache does not evaluate %{...} variables. Instead each individual module has to evaluate them. mod_pagespeed does not currently evaluate them.

You could request it as a feature at: https://code.google.com/p/modpagespeed/issues/list . I think I remember there being a similar feature request, but I cannot find it.