I made an .htaccess template; is there anything else that should be added or changed?

Posted by purpler on Server Fault See other posts from Server Fault or by purpler
Published on 2010-05-01T09:57:32Z Indexed on 2010/05/01 10:08 UTC
Read the original article Hit count: 402

Filed under:
|
|
|
|
# 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>

© Server Fault or respective owner

Related posts about .htaccess

Related posts about apache2