简体   繁体   English

.htaccess和httpd.conf文件的位置

[英]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: 为此,我需要向.htaccess文件或apache服务器上的httpd.conf文件中添加以下代码:

<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. 但是我不知道在哪里可以找到.htaccess和httpd.conf文件。 Can anybody tell where i will find these files? 谁能告诉我在哪里可以找到这些文件?

.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 . ). .htaccess文件在任何Web目录中,您可能需要启用点文件的可见性才能读取它们( .htaccess被视为点文件,因为它以.开头)。

To find the location of httpd.conf , use this link: 要找到httpd.conf的位置,请使用以下链接:

DistrosDefaultLayout - Httpd Wiki DistrosDefaultLayout-httpd Wiki

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM