Bug 60804

Summary: ExpiresByType and ExpiresDefault is ignored when used SetHandler application/x-httpd-php
Product: Apache httpd-2 Reporter: Binyamin <7raivis>
Component: mod_expiresAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: major CC: 7raivis
Priority: P2    
Version: 2.4.25   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Binyamin 2017-03-02 15:19:36 UTC
/sitemap.xml Response Headers shows 1 day expiration while expected to be 1 year (or at least 1 week)

    Content-Type: application/xml; charset=utf-8
    Date:         Tue, 27 Dec 2016 19:59:00 GMT
    Expires:      Wed, 28 Dec 2016 19:59:00 GMT

seems SetHandler forces text/html expiration and doesn't allow to rewrite it

    ExpiresActive On
    ExpiresDefault                "access plus 1 month"
    ExpiresByType text/html       "access plus 1 day"
    ExpiresByType application/xml "access plus 1 week"

    <FilesMatch ^sitemap\.xml$>
        SetHandler application/x-httpd-php
        Header set Content-Type "application/xml"
        ExpiresDefault "access plus 1 year"

the loaded modules order doesn't fix it either

LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so