我制作了一个.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>
最佳答案
关闭ETags [1]
FileETag None
ServerTokens产品,ServerSignature关闭[2]
ServerTokens prod
ServerSignature Off
[1]:http://www.askapache.com/htaccess/apache-speed-etags.html关闭ETag
[2]:http://www.petefreitag.com/item/419.cfm ServerTokens产品,ServerSignature关闭