ylsunyuan技术论坛中心

 找回密码
 注册(请使用中文注册)
搜索
热搜: 活动 交友 discuz
查看: 863|回复: 0
打印 上一主题 下一主题

Ali-Linux SEO相关配置

[复制链接]

124

主题

127

帖子

619

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
619
跳转到指定楼层
楼主
发表于 2015-10-10 10:23:04 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
一、开启网页资源GZIP压缩
引入模块
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
增加规则
<IfModule deflate_module>
SetOutputFilter DEFLATE
# Don’t compress images and other
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:pdf|doc)$ no-gzip dont-vary
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
来源:http://jingyan.baidu.com/article/db55b609a7bc234ba20a2f7e.html


二、设置网站缓存来提高网页访问
引入模块 mod_expires
在.htaccess文件中写入以下内容(模块规则)
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A600
ExpiresByType image/x-icon A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/css A604800
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/plain A86400
ExpiresByType application/x-shockwave-flash A2592000
ExpiresByType video/x-flv A2592000
ExpiresByType application/pdf A2592000
ExpiresByType text/html A600
</IfModule>


相关帖子

回复

使用道具 举报

本版积分规则

QQ|Archiver|手机版|小黑屋|ylsunyuan技术论坛 ( 桂ICP备14005218号-1

GMT+8, 2024-4-26 11:29 , Processed in 0.073003 second(s), 35 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表