Forum Moderators: coopster
My HTML files are parsed for PHP, declared in .htaccess:
AddHandler application/x-httpd-php .php .html
Because my hosts default php.ini blocks a few things I want, I wrote a custom php.ini to override it -this is working well.
My File Expirary params are also set in .htaccess:
ExpiresActive On
ExpiresDefault A21600
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
<FilesMatch "^(error¦forbidden)\.html$">
ExpiresDefault A0
</FilesMatch>
...but are not being passed into the HTTP header.
If I remove the PHP/HTML handler from my .htaccess, the expirary settings do display in the HTTP header.
So I think my host's default php.ini is blocking it.
How do I allow the above file expirary settings in my custom php.ini?
All I've seen is session/cookie expirary setting examples so far when I search.
Thanks.
[edited by: DaveAtIFG at 1:09 pm (utc) on July 31, 2004]
[edit reason] Off topic [/edit]
this is an issue between apache and php. for your mod_expires settings, apache works well:
This module controls the setting of the Expires HTTP header in server responses. The expiration date can set to be relative to either the time the source file was last modified, or to the time of the client access.(from the apache docs)
but php is not bound to the apache mods that near, it will take the apache settings instead of phps own. checkout php documentation to set the expire headers [php.net] in the HTTP response.
...for your mod_expires settings, apache works well
Thanks Hakre. But when the pages are parsed for PHP, the mod_expires settings stop being displayed in the HTTP header. Now maybe they are still being received by the user, but I don't know this. The header info is all I have to go on.
My host's default php.ini was also blocking charset encoding from passing to the HTTP header. My custom php.ini overrides it and charset now appears in the header as it should. I was hoping to do the same with the file expirary settings. Thanks again.
checkout php documentation to set the expire headers in the HTTP response
Thanks, but that link exemplifies how to send header info from the HTML page, using PHP. This would envolve adding that tag to thousands of pages over many websites. Not what I'm askling.
I want to do it globally, once per site. I still see no evidence that the mod_expire settings are giving this information through HTTP headers given the fact that the host's default php.ini file is blocking it when the HTML files are parsed for PHP.
Thanks again.