.htaccess template
I made an .htaccess template; is there anything else that should be added or changed?
# DEFAULTS
ServerSignature Off
AddDefaultCharset UTF-8
DefaultLanguage en-US
SetEnv Europe/Belgrade
SetEnv SERVER_ADMIN chrisp@dejan.com.au
# 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
<File开发者_如何学编程s .htaccess>
order allow,deny
deny from all
</Files>
Turn Off ETags [1]
FileETag None
ServerTokens Prod, ServerSignature Off [2]
ServerTokens prod
ServerSignature Off
[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
精彩评论