0

我使用类似的方法将 Google Analytics 动态附加到我网站上的所有页面。

Options +Includes
AddHandler server-parsed .html
AddHandler application/x-httpd-php .html

# These values are used for local testing...
#php_value auto_prepend_file D:/wamp/www/_prepend.php
#php_value auto_append_file D:/wamp/www/_append.php

# These values are used on production server...
php_value auto_prepend_file /var/vcap.local/dea/app/_prepend.php
php_value auto_append_file /var/vcap.local/dea/app/_append.php

我已经注释掉了第一对,因为目前我一次只能在一个服务器上运行。是否可以修改它以.htaccess使其自动与两台服务器一起使用?

4

1 回答 1

1

auto_append_file 和 auto_prepend_file 都使用包含路径,因此如果环境在包含路径中有相关目录,则应该可以执行以下操作:

php_value auto_prepend_file _prepend.php
php_value auto_append_file _append.php
于 2013-07-10T05:53:17.673 回答