首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >关闭mod_pagespeed后如何重定向旧路径(代码.{<filename>.pagespeed.ce})

关闭mod_pagespeed后如何重定向旧路径(代码.{<filename>.pagespeed.ce})
EN

Stack Overflow用户
提问于 2013-05-29 18:08:34
回答 2查看 709关注 0票数 1

我的问题是,我在一些目录中禁用了代码,但爬虫保留了指向分页速度特殊文件(以.pagespeed.ce.{ mod_pagespeed }结尾的文件)的URL。以下是错误消息:

代码语言:javascript
复制
[Sun May 26 16:34:22 2013] [error] [mod_pagespeed 1.3.25.4-2941 @15589] Rejected absolute url reference http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg
[Sun May 26 16:34:22 2013] [warn] [mod_pagespeed 1.3.25.4-2941 @15589] [0526/163422:WARNING:resource_fetch.cc(186)] Fetch failed for resource url http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg.pagespeed.ce.TbYJiXXl15.jpg
[Sun May 26 16:34:22 2013] [warn] [mod_pagespeed 1.3.25.4-2941 @15589] Fetch failed for http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg.pagespeed.ce.TbYJiXXl15.jpg, status=404
[Sun May 26 16:34:25 2013] [error] [mod_pagespeed 1.3.25.4-2941 @6364] Rejected absolute url reference http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg
[Sun May 26 16:34:25 2013] [warn] [mod_pagespeed 1.3.25.4-2941 @6364] [0526/163425:WARNING:resource_fetch.cc(186)] Fetch failed for resource url http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg.pagespeed.ce.TbYJiXXl15.jpg
[Sun May 26 16:34:25 2013] [warn] [mod_pagespeed 1.3.25.4-2941 @6364] Fetch failed for http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg.pagespeed.ce.TbYJiXXl15.jpg, status=404
[Sun May 26 16:34:25 2013] [error] [mod_pagespeed 1.3.25.4-2941 @6379] Rejected absolute url reference http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg
[Sun May 26 16:34:25 2013] [warn] [mod_pagespeed 1.3.25.4-2941 @6379] [0526/163425:WARNING:resource_fetch.cc(186)] Fetch failed for resource url http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg.pagespeed.ce.TbYJiXXl15.jpg
[Sun May 26 16:34:25 2013] [warn] [mod_pagespeed 1.3.25.4-2941 @6379] Fetch failed for http://www.sansook.in.th/u/2013/05/17/skLrmH.jpg.pagespeed.ce.TbYJiXXl15.jpg, status=404

我只是想知道是否有任何mod_pagespeed内置功能可以自动将无效路径(我之前启用了mod但后来删除它的路径)重定向到正确的路径(只需删除代码。{.pagespeed.ce})。

有人告诉我,mod_pagespeed通常会在默认情况下重写旧路径,只要它被启用。然而,这不适用于我的情况。我仍然开着mod_pagespeed,但它不工作。下面是我的相关配置:

conf/httpd.conf (部分)

代码语言:javascript
复制
Include conf.d/*.conf

NameVirtualHost 27.254.41.229:80
NameVirtualHost 27.254.41.227:80

<VirtualHost 27.254.41.227:80>
    DocumentRoot /var/www/sansook
    ServerName www.sansook.in.th
    ServerAlias sansook.in.th

    <Directory /var/www/sansook>
        Options -Indexes -Multiviews
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    RewriteEngine On
    RewriteCond   %{HTTP_HOST} !^www\.sansook\.in\.th$ [NC]
    RewriteRule   ^(.*)$ http://www.sansook.in.th$1 [L,R=301]
</VirtualHost>

conf.d/pagespeed.conf (完整,删除注释)

代码语言:javascript
复制
<IfModule !mod_version.c>
  LoadModule version_module /usr/lib64/httpd/modules/mod_version.so
</IfModule>

<IfVersion < 2.4>
  LoadModule pagespeed_module /usr/lib64/httpd/modules/mod_pagespeed.so
</IfVersion>
<IfVersion >= 2.4.2>
  LoadModule pagespeed_module /usr/lib64/httpd/modules/mod_pagespeed_ap24.so
</IfVersion>

<IfModule !mod_deflate.c>
 LoadModule deflate_module /usr/lib64/httpd/modules/mod_deflate.so
</IfModule>

<IfModule pagespeed_module>
    ModPagespeed on
    ModPagespeedAllow http://www.sansook.in.th/*
    ModPagespeedDisallow http://www.sansook.in.th/u/*
    ModPagespeedDisallow http://www.sansook.in.th/tmp/*

    ModPagespeedInheritVHostConfig on

    AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html

    ModPagespeedFileCachePath            "/var/cache/mod_pagespeed/"

    ModPagespeedRewriteLevel CoreFilters
    ModPagespeedEnableFilters collapse_whitespace,combine_javascript,remove_comments

    ModPagespeedDomain *.sansook.in.th
    ModPagespeedFileCacheInodeLimit        500000
    ModPagespeedAvoidRenamingIntrospectiveJavascript on
    ModPagespeedLibrary 43 1o978_K0_LNE5_ystNklf http://www.modpagespeed.com/rewrite_javascript.js

    <Location /mod_pagespeed_beacon>
          SetHandler mod_pagespeed_beacon
    </Location>
    <Location /mod_pagespeed_statistics>
        Allow from localhost
        Allow from 127.0.0.1
        SetHandler mod_pagespeed_statistics
    </Location>
    <Location /mod_pagespeed_console>
        Order allow,deny
        # This can be configured similarly to mod_pagespeed_statistics above.
        Allow from localhost
        Allow from 127.0.0.1
        SetHandler mod_pagespeed_console
    </Location>
    ModPagespeedMessageBufferSize 100000

    <Location /mod_pagespeed_message>
        Allow from localhost
        Allow from 127.0.0.1
        SetHandler mod_pagespeed_message
    </Location>
    <Location /mod_pagespeed_referer_statistics>
        Allow from localhost
        Allow from 127.0.0.1
        SetHandler mod_pagespeed_referer_statistics
    </Location>
</IfModule>

apachectl -t -D DUMP_MODULES

代码语言:javascript
复制
Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_file_module (shared)
 authn_alias_module (shared)
 authn_anon_module (shared)
 authn_dbm_module (shared)
 authn_default_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 authz_owner_module (shared)
 authz_groupfile_module (shared)
 authz_dbm_module (shared)
 authz_default_module (shared)
 ldap_module (shared)
 authnz_ldap_module (shared)
 include_module (shared)
 log_config_module (shared)
 logio_module (shared)
 env_module (shared)
 ext_filter_module (shared)
 mime_magic_module (shared)
 expires_module (shared)
 deflate_module (shared)
 headers_module (shared)
 usertrack_module (shared)
 setenvif_module (shared)
 mime_module (shared)
 dav_module (shared)
 status_module (shared)
 autoindex_module (shared)
 info_module (shared)
 dav_fs_module (shared)
 vhost_alias_module (shared)
 negotiation_module (shared)
 dir_module (shared)
 actions_module (shared)
 speling_module (shared)
 userdir_module (shared)
 alias_module (shared)
 substitute_module (shared)
 rewrite_module (shared)
 proxy_module (shared)
 proxy_balancer_module (shared)
 proxy_ftp_module (shared)
 proxy_http_module (shared)
 proxy_ajp_module (shared)
 proxy_connect_module (shared)
 cache_module (shared)
 suexec_module (shared)
 disk_cache_module (shared)
 cgi_module (shared)
 version_module (shared)
 unique_id_module (shared)
 jk_module (shared)
 pagespeed_module (shared)
 php5_module (shared)
 ssl_module (shared)
Syntax OK

任何帮助或进一步的调查建议,我们将不胜感激。谢谢!

-Ake

EN

回答 2

Stack Overflow用户

发布于 2013-06-23 23:26:56

如果您继续安装mod_pagespeed,但将其设置为off,它仍然会注意到.pagespeed. urls服务于适当的资源,但不会执行任何其他操作。(doc link)

票数 0
EN

Stack Overflow用户

发布于 2013-09-06 03:43:59

正如杰夫所指出的,即使您有ModPagespeed off,我们也会正确地为您提供.pagespeed.资源。但是,我们不会为您提供服务,因为您使用的是ModPagespeedDisallow。在这种情况下,我们似乎仍然应该为.pagespeed.提供服务。我为此打开了一个新的bug:https://code.google.com/p/modpagespeed/issues/detail?id=775

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16811053

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档