添加<!--#include file="xxx.html"-->或<!--#include virtual="/xxx.html"-->服务器端包含SSI
AddHandler server-parsed .html
配置https跳转
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.xxxx.com/$1 [R=301,L]
</IfModule>
设置文件缓存时间
<FilesMatch ".(woff|mp4|flv|gif|jpg|jpeg|png|ico|swf|js|css)$">
Header set Cache-Control "max-age=2592000"
</FilesMatch>
配置服务器压缩技术
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URL .(?:gif|jpe?g|png|exe|t?gz|zip|bz2|sit|rar|pdf|mov|avi|mp3|mp4|rm)$ no-gzip dont-vary
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-httpd-php application/x-javascript
</IfModule>
网友评论