.htaccess 模板
我制作了一个 .htaccess 模板;还有什么需要补充或改变的吗?
# DEFAULTS
ServerSignature Off
AddDefaultCharset UTF-8
DefaultLanguage en-US
SetEnv Europe/Belgrade
SetEnv SERVER_ADMIN [email protected]
# Rewrites
RewriteEngine On
RewriteBase /
# Redirect to WWW
RewriteCond %{HTTP_HOST} ^serpentineseo.com
RewriteRule (.*) http://www.serpentineseo.com/$1 [R=301,L]
# Cache media files
<filesMatch "\.(gif|jpg|jpeg|png|ico|swf|js)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<FilesMatch "\.(js|css|pdf|swf)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
<FilesMatch "\.(html|htm|txt)$">
Header set Cache-Control "max-age=600"
</FilesMatch>
# DONT CACHE
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
# Deny access to .htaccess
<Files .htaccess>
order allow,deny
deny from all
</Files>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
关闭 ETags [1]
ServerTokens Prod、ServerSignature 关闭 [2]
[1]: http://www.askapache.com/htaccess/apache-speed-etags.html 关闭 ETags
[2]:http://www.petefreitag.com/item/419.cfm ServerTokens Prod、ServerSignature 关闭
Turn Off ETags [1]
ServerTokens Prod, ServerSignature Off [2]
[1]: http://www.askapache.com/htaccess/apache-speed-etags.html Turn off ETags
[2]: http://www.petefreitag.com/item/419.cfm ServerTokens Prod, ServerSignature Off