Unable to enable .htaccess (Leverage Browser Caching)
Gezzz. . . I thought I followed the steps correctly to enable .htaccess, but it's not enabling (I test it on Google PageSpeed Insights and also by uploading a changed jpg image).
If anyone has any ideas to share, it sure would be appreciated. Here are the steps I took:
1.) My .htaccess file has only the below content and is located in my document root directory with all of my website content:
EXPIRES CACHING
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
EXPIRES CACHING
2.) I disabled the apache default config file and have my own that handles my website content. In my sites-available config file located at
.htaccess file location
Options Indexes FollowSymLinks MultiViews
Order allow,deny
allow from all
3.) And in my apache config file
AccessFileName .htaccess
Deny from all
Satisfy all
Thank you in advance for any suggestions.
–Eric
3 Replies
I'm using Ubuntu 12.04 rather than Debian.
And, no, I don't have have any LoadModule expires directives in my virtual host config file: /etc/apache2/sites-available/myconfig.conf which is the file that overrides my document root contents directives, but in only my .htaccess file as above.
Should I also have LoadModule expires directives in virtual host config file to enable .htaccess? If so, are there instructions on how to write them?
Much thanks for the help.
Eric
If not, you should probably search the web for: ubuntu apache php load mod_expires