Dar*_*ein 4 .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]
Run Code Online (Sandbox Code Playgroud)
服务器管理员安装了Google mod_pagespeed,当然,因为该文件夹不存在,所以每次尝试访问时都会记录错误/mod_pagespeed_beacon(并且不会记录任何统计信息).
RewriteCond我需要添加什么(以及在哪里)/mod_pagespeed_beacon才能工作?
找到了我的问题的答案.只需添加以下内容:
RewriteCond %{REQUEST_URI} !^/mod_pagespeed_beacon
Run Code Online (Sandbox Code Playgroud)
我认为在重写条件列表中的位置并不重要.
- 编辑
我还需要以下内容来访问统计信息:
RewriteCond %{REQUEST_URI} !^/mod_pagespeed_statistics
Run Code Online (Sandbox Code Playgroud)
更一般地说,您可以使用pagespeed以下名称将所有资源列入白名单:
RewriteCond %{REQUEST_URI} !pagespeed
Run Code Online (Sandbox Code Playgroud)