Php 邮件头不工作

Php 邮件头不工作,php,apache,.htaccess,Php,Apache,.htaccess,在多次搜索引擎优化测试中,我得到的回答是 您的站点未对所有图像使用expires标头 但是,这是我的.htaccess的一部分: htaccess # Expires Headers <IfModule mod_expires.c> # Enable expirations ExpiresActive On # Default directive ExpiresDefault "access plus 1 month" # My fav

在多次搜索引擎优化测试中,我得到的回答是

您的站点未对所有图像使用expires标头

但是,这是我的
.htaccess
的一部分:

htaccess

# Expires Headers
<IfModule mod_expires.c>

    # Enable expirations
    ExpiresActive On

    # Default directive
    ExpiresDefault "access plus 1 month"


    # My favicon
    ExpiresByType image/x-icon "access plus 1 year"

    # Images
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"

    # CSS
    ExpiresByType text/css "access plus 1 month"

    # Javascript
    ExpiresByType application/javascript "access plus 1 year"

</IfModule>
请求

GET /img/tap-logo.png HTTP/1.1
Host: tap.#######.com/
Connection: keep-alive
Pragma: no-cache
Cache-Control: max-age=0
Accept: image/webp,*/*;q=0.8
If-Modified-Since: Tue, 16 Jun 2015 12:23:44 GMT
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36
Referer: http://www.#######.com/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,en-GB;q=0.6

为什么不起作用?如何修复?

是否启用mod_expires.c模块?请张贴此类图像返回的标题(例如来自F12工具)我如何知道
mod_expires.c
模块是否已启用?我已经在编辑中向我的问题添加了标题的详细信息。也许你也从不同的域/不同的服务器获取图像,而该图像不提供
Expires
标题?@Marki555-它只来自不同的目录。在本例中,页面为
http://tap.example.com/index.php
并且图像是
http://tap.example.com/img/tap-logo.png
.htaccess
文件位于
http://tap.example.com/.htaccess
这是该页面上唯一的图像吗?查看响应头,
Expires
头的设置正确。这就是为什么我问这个页面是否也包含外部图像
GET /img/tap-logo.png HTTP/1.1
Host: tap.#######.com/
Connection: keep-alive
Pragma: no-cache
Cache-Control: max-age=0
Accept: image/webp,*/*;q=0.8
If-Modified-Since: Tue, 16 Jun 2015 12:23:44 GMT
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36
Referer: http://www.#######.com/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,en-GB;q=0.6