序列重新.HTACCESS文件

时间:2017-03-22 15:51:37

标签: apache .htaccess

我试图为网站生成一个简单的.htacces文件。目前只有3个命令,这是它们出现在文件中的顺序:

# KEEP ALIVE #
# OPTIMIZE WEBSITE #
# 404 #

当我添加第四个元素时 -

# EXPIRES CACHING #:
# KEEP ALIVE #
# OPTIMIZE WEBSITE #
# EXPIRES CACHING #
# 404 #

404命令失败。

这些说明是否应该遵循正确的顺序才能使它们起作用?

## KEEP ALIVE ##
<ifModule mod_headers.c> 
Header set Connection keep-alive 
</ifModule>
## KEEP ALIVE ##  

## OPTIMIZE WEBSITE ##
<IfModule mod_deflate.c> 
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css             application/x-javascript 
BrowserMatch ^Mozilla/4 gzip-only-text/html 
BrowserMatch ^Mozilla/4\.0[678] no-gzip 
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html 
</IfModule>
## OPTIMIZE WEBSITE ## 

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/html "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwaveflash "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 1 month"
</IfModule>
## EXPIRES CACHING ##

## 404 ##
ErrorDocument 404 /404.html
## 404 ##

0 个答案:

没有答案