mod_rewrite mod_pagespeed RewriteCond
我的 .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
起作用?
I have the following in my .htaccess file:
# 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]
The server admin has installed Google mod_pagespeed and of course, because the folder doesn't exist, it logs an error every time as it tries to access /mod_pagespeed_beacon
(and no stats are logged).
What RewriteCond
do I need to add (and where) so /mod_pagespeed_beacon
will work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
找到了我的问题的答案。只需添加以下内容:
我认为重写条件列表中的位置并不重要。
-- 编辑
我还需要以下内容来访问统计信息:
Found the answer to my question. Just add the following:
I don't think it matters where in the list of rewrite conditions is goes.
-- Edit
I also needed the following to access the statistics:
更一般地说,您可以将名称中包含
pagespeed
的所有资源列入白名单:请参阅新mod_pagespeed 常见问题解答部分
More generally you can whitelist all resources with
pagespeed
in the name with:See the new section in the mod_pagespeed FAQ
我有 vBulletin 4 Suite + vBSEO
发现.htaccess中的这一行解决了问题
将其放在该行之前
I have vBulletin 4 Suite + vBSEO
Found that this line in .htaccess sorted out the problem
Place it before this line in