Skip to content

Instantly share code, notes, and snippets.

@jafstar
Created May 26, 2012 04:08
Show Gist options
  • Save jafstar/2792135 to your computer and use it in GitHub Desktop.
Save jafstar/2792135 to your computer and use it in GitHub Desktop.
htaccess
Options +FollowSymLinks All -Indexes -MultiViews
#TIMEZONE
SetEnv TZ America/New_York
#America/Chicago
#America/Phoenix
#America/Los_Angeles
#TURN ON PHP 5.3 FOR SPECIFIC HOSTS
AddHandler application/x-httpd-php53 .php
#STRIP WWW
RewriteCond %{HTTP_HOST} !^yoursite.com$ [NC]
RewriteRule ^(.*)$ http://yoursite.com/$1 [L,R=301]
# Disable ETags
<IfModule mod_header.c>
Header Unset ETag
FileETag none
</IfModule>
# Default expires header if none specified (stay in browser cache for 7 days)
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A604800
</IfModule>
#Disable Server Signatures
ServerSignature Off
ServerTokens Prod
#Limit Uploads 10MB
LimitRequestBody 10240000
#Protect the htaccess file
<files .htaccess>
order allow,deny
deny from all
</files>
#Protect wpconfig.php
<files wp-config.php>
order allow,deny
deny from all
</files>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment