.htaccess - mod_rewrite mod_pagespeed RewriteCond

标签 .htaccess mod-rewrite mod-pagespeed

我的 .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 起作用?

最佳答案

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

RewriteCond %{REQUEST_URI} !pagespeed

查看 new section in the mod_pagespeed FAQ

关于.htaccess - mod_rewrite mod_pagespeed RewriteCond,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4099659/

相关文章:

.htaccess - 使用 .htaccess 更改索引文件夹

linux - 有没有办法用 .htaccess 密码保护目录并让它记住密码?

apache - .htaccess mod_rewrite 子目录到 URL 参数

apache - .htaccess 从 Host 重写到没有 uri 的静态站点

apache - mod_pagespeed 与亚马逊 S3

php - fatal error : Uncaught exception 'Zend_Db_Table_Exception'

.htaccess - 从 htaccess 迁移到 nginx 配置失败

Apache "File not found."而不是 404. 错误文档

javascript - Google 的 mod_pagespeed 是否提供 CSS 和 js 文件的自动版本控制?

javascript - Pagespeed 脚本添加,它有什么作用?