a Learner
a Learner

Reputation: 5042

Location of .htaccess and httpd.conf files

I am trying to use leverage browser caching option in order to increase google page speed rank. For that purpose i need to add following code to .htaccess file or in httpd.conf file on apache server:

<IfModule mod_expires.c>

ExpiresActive On

ExpiresDefault "access plus 1 month"

ExpiresByType image/x-icon "access plus 1 year”

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"


ExpiresByType text/css "access 1 month”


ExpiresByType application/javascript "access plus 1 year"

</IfModule>

But i dont know where to find .htaccess and httpd.conf file. Can anybody tell where i will find these files?

Upvotes: 0

Views: 3822

Answers (1)

MrMike
MrMike

Reputation: 1540

.htaccess files are in any web directory, and you may need to enable visibility of dot-files to read them (.htaccess is considered a dot-file since it begins with a .).

To find the location of httpd.conf, use this link:

DistrosDefaultLayout - Httpd Wiki

Upvotes: 1

Related Questions