Expires headers in .htaccess

#1
Hi,

When I set the ExpiresByType headers in a site's .htaccess file, it somehow screws up the php handler causing the server to send php scripts as downloads instead of parsing them.

Have you ever seen this before?

Using CentOS 5.7,
Litespeed Web Server Enterprise v4.1.8

Thanks,
 

webizen

Well-Known Member
#2
assuming php serves normally once the headers get removed from .htaccess. if so, please provide a snippet of the headers for our troubleshooting.
 
#3
Hi,

Yes, with the headers commented out, PHP serves fine. Here's the section:

############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires

ExpiresActive On

# ExpiresDefault "access plus 1 year"
# ExpiresByType image/x-icon "access plus 1 year"
# ExpiresByType image/png "access plus 1 year"
# ExpiresByType image/gif "access plus 1 year"
# ExpiresByType image/jpg "access plus 1 year"
# ExpiresByType application/x-javascript "access plus 1 year"
# ExpiresByType application/javascript "access plus 1 year"
# ExpiresByType application/js "access plus 1 year"
# ExpiresByType text/css "access plus 1 year"
# ExpiresByType text/html "access plus 1 year"
# ExpiresByType text/xml "access plus 1 year"
# ExpiresByType text/plain "access plus 1 year"
# ExpiresByType image/jpeg "access plus 1 year"
# ExpiresByType text/javascript "access plus 1 year"

I tried uncommenting them one by one, but even after the ExpiresDefault I get the error.

Thanks!
 

mistwang

LiteSpeed Staff
#4
Tried those directives in .htacess, works fine. we probably need the whole .htaccess in order to reproduce it in our lab.
How about adding

AddType application/x-httpd-php .php

to the .htaccess?
 
Top