apache_conf 加速WordPress自托管站点。此内容在#BEGIN WordPress之前进入.htaccess文件。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf 加速WordPress自托管站点。此内容在#BEGIN WordPress之前进入.htaccess文件。相关的知识,希望对你有一定的参考价值。


## If your server has a redirect problem with 
## .htpasswds protection on wp-admin directory, add the following:

ErrorDocument 401 default



## ------- UNSET PRAGMA ------ 
## https://www.mnot.net/cache_docs/#PRAGMA
##Pragma HTTP Headers (and why they don't work)

Header unset Pragma
FileETag None
Header unset ETag


## ------- EXPIRES CACHING ------ 
<IfModule mod_expires.c>
ExpiresActive On
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"
</IfModule>
## EXPIRES CACHING ##


## ------- GZIP ------ 
## compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/js
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddType x-font/otf .otf
AddType x-font/ttf .ttf
AddType x-font/eot .eot
AddType x-font/woff .woff
AddType image/x-icon .ico
AddType image/png .png


## ----------- End don't touch the #BEGIN WordPress Area ------------- 

以上是关于apache_conf 加速WordPress自托管站点。此内容在#BEGIN WordPress之前进入.htaccess文件。的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf Wordpress .htaccess

apache_conf wordpress htaccess

apache_conf WordPress安全

apache_conf Wordpress htaccess

apache_conf Wordpress .htaccess

apache_conf 强化Wordpress网站