4

我的 .htaccess 文件中有以下内容:

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]

服务器管理员已经安装了 Google mod_pagespeed,当然,因为该文件夹不存在,它每次尝试访问时都会记录一个错误/mod_pagespeed_beacon(并且没有记录任何统计信息)。

RewriteCond我需要添加什么(以及在哪里)/mod_pagespeed_beacon才能起作用?

4

3 回答 3

7

找到了我的问题的答案。只需添加以下内容:

RewriteCond %{REQUEST_URI} !^/mod_pagespeed_beacon

我认为重写条件列表的位置并不重要。

- 编辑

我还需要以下内容来访问统计信息:

RewriteCond %{REQUEST_URI} !^/mod_pagespeed_statistics
于 2010-11-04T21:54:19.353 回答
5

更一般地说,您可以将名称中的所有资源列入白名单pagespeed

RewriteCond %{REQUEST_URI} !pagespeed

请参阅mod_pagespeed 常见问题解答中的新部分

于 2014-11-20T18:23:11.470 回答
2

我有 vBulletin 4 Suite + vBSEO 发现 .htaccess 中的这一行解决了问题

# mod_pagespeed
RewriteCond %{REQUEST_URI} !(mod_pagespeed_statistics|mod_pagespeed_beacon) [NC]

把它放在这条线之前

RewriteRule ^(.+)$ vbseo.php [L,QSA]
于 2011-01-19T10:35:51.733 回答