wordpress开启gzip技巧
编辑整理:整理来源:抖音,浏览量:104,时间:2023-03-02 00:45:01
wordpress开启gzip技巧,wordpress.org,wordpress打开
关于wordpress开启gzip技巧内容导航:
1、wordpress开启gzip技巧
1. 在WordPress根目录的.htaccess文件中添加以下代码:
```
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-optype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/optype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header appd Vary User-Agent
```
2. 在WordPress根目录的wp-config.php文件中添加以下代码:
```
define('COMPRESS_CSS', true);
define('COMPRESS_SCRIPTS', true);
define('ENFORCE_GZIP', true);
```
2、wordpress怎么打开
后台打开慢,应该是调用Google酷造成的,建议更换为360的
3、wordpress开启https
需要有一个php空间,并且要支持MySQL数据库的,如果找不到的话可以跟我一样用个免费的国外空间,我的是iifree.net的,然后你下载一个wordpress,可以在http://wordpress.org.cn/forums/下载到最新的版本,然后开始配置,其实很简单的,先申请完空间,配置好你的空间用户名以及密码和MySQL数据库的用户名以及密码,再把你的wordpress文件中的wp-config-sample.php文件用记事本打开,然后配置如下,
找到
// ** MySQL settings ** //
define('DB_NAME', 'putyourdbnamehere'); // The name of the database
define('DB_USER', 'usernamehere'); // Your MySQL username
define('DB_PASSWORD', 'yourpasswordhere'); // ...and password
我配置好了是这个样子的
// ** MySQL settings ** //
define('DB_NAME', 'zhaom_ing'); // The name of the database
define('DB_USER', 'zhaom_ing'); // Your MySQL username
define('DB_PASSWORD', '******'); // ...and password
其中putyourdbnamehere换成你建立的MySQL数据库名字,usernamehere换
行业热门话题:
【wordpress怎么打开】【wordpress开启https】【wordpress zibll】【wordpress.org】【wordpress site】【wordpresscom】【如何打开wordpress】【wordpress打开】【wordpress网址怎么打开】【怎么用wordpress打开网站】
wordpress开启gzip技巧完!