1

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>
4

1 回答 1

0

我认为 Apache 不评估%{...}变量。相反,每个单独的模块都必须评估它们。mod_pagespeed目前不评估它们。

您可以在https://code.google.com/p/modpagespeed/issues/list 上将其作为一项功能请求。我想我记得有一个类似的功能请求,但我找不到它。

于 2014-01-14T17:41:34.533 回答