2

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>
bbullis
  • 532
  • 7
  • 20

1 Answers1

0

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.

sligocki
  • 6,246
  • 5
  • 38
  • 47
  • Thank you. I didn't know exactly how modules handle this kind of information. I never came up with a solution, we had to manually go into each box dev, staging and production and set that ModPagespeedDomain with the proper value. – bbullis Jan 14 '14 at 21:29