LMcCurdy/gavin-2015/master/.htaccess - Htaccess File

LMcCurdy/gavin-2015/master/.htaccess

Header set X-Powered-By 'Caffeine and Alcohol'
ErrorDocument 404 http://www.gavinadvertising.com/404error.php

RewriteEngine on
RewriteCond %{HTTP_HOST} ^gavinadvertising.com [NC]
RewriteRule ^(.*)$ http://www.gavinadvertising.com/$1 [L,R=301]

RewriteCond %{HTTP_REFERER} semalt.com [NC]
RewriteRule .* – [F]

# cache control
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff .woff

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/gif "access plus 1 month"
  ExpiresByType image/jpeg "access plus 1 month"
  ExpiresByType image/png "access plus 1 month"
  ExpiresByType text/css "access plus 1 week"
  ExpiresByType text/javascript "access plus 1 week"
  ExpiresByType application/javascript "access plus 1 week"
  ExpiresByType application/x-javascript "access plus 1 week"
  ExpiresByType image/x-icon "access plus 1 year"
  ExpiresByType image/svg+xml "access plus 1 year"
  ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
  ExpiresByType application/font-woff "access plus 1 year"
  ExpiresByType application/x-font-woff "access plus 1 year"
  ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
  ExpiresByType font/opentype "access plus 1 year"
  ExpiresByType font/ttf "access plus 1 year"
  ExpiresByType font/otf "access plus 1 year"
  ExpiresByType application/x-font-ttf "access plus 1 year"
  ExpiresByType application/x-font-otf "access plus 1 year"
</IfModule>

# deny bad bots
SetEnvIfNoCase User-Agent xovi bad_bot
SetEnvIfNoCase User-Agent majestic bad_bot
SetEnvIfNoCase User-Agent panscient.com bad_bot
SetEnvIfNoCase User-Agent aboundex bad_bot
SetEnvIfNoCase Referer semalt.com bad_bot

<Limit GET POST HEAD>
  order allow,deny
  allow from all
  deny from env=bad_bot
</Limit>

<Files 403.shtml>
  order allow,deny
  allow from all
</Files>

# Redirects
Redirect 301 /in-the-hall/you-know-youre-in-public-relations-when/     http://gavinadvertising.com/orangejuice/you-know-youre-in-public-relations-when
Redirect 301 /g-peeps                          http://gavinadvertising.com/meet-the-team.php
Redirect 301 /our-work/york-technical-institute.php            http://gavinadvertising.com/our-work/yti-career-institute.php
Redirect 301 /digs                            http://gavinadvertising.com/about-gavin-advertising.php
Redirect 301 /website-development/                    http://gavinadvertising.com/our-work/index.php#digital
Redirect 301 /category/in-the-hall/                    http://gavinadvertising.com/orangejuice
Redirect 301 /bragging/gavin-advertising-wins-two-gold-hermes-creative-awards-for-web-design-and-strategic-co-marketing-campaign/ http://gavinadvertising.com/orangejuice/gavin-advertising-wins-two-gold-hermes-creative-awards-for-web-design-and-strategic-co-marketing-campaign

RewriteCond  %{HTTP_HOST}  !^www.gavinadvertising.com$ [NC]
# skip rules if NOT within domain - only way to tie multiple rules to one cond
RewriteRule  .?  -  [S=5]
RewriteRule ^about/?$          http://gavinadvertising.com/about-gavin-advertising.php [L,R=301]
RewriteRule ^contact/?$        http://gavinadvertising.com/contact-us.php [L,R=301]
RewriteRule ^public-relations/?$    http://www.gavinadvertising.com/our-work/index.php#pr [L,R=301]
RewriteRule ^jobs/?$          http://gavinadvertising.com/orangejuice/category/careers [L,R=301]
RewriteRule ^case-studies/?$      http://gavinadvertising.com/our-work [L,R=301]

# bad people
deny from 5.0.0.0/8
deny from 37.0.0.0/8
deny from 78.4.0.0/14
deny from 93.32.0.0/11
deny from 94.32.0.0/13
deny from 46.118.119.0/24
deny from 46.160.80.0/21
deny from 46.188.0.0/18
deny from 89.96.0.0/24
deny from 89.97.0.0/24
deny from 91.200.12.0/22
deny from 91.212.124.0/24
deny from 91.215.136.0/23
deny from 91.230.200.0/22
deny from 91.238.82.201
deny from 105.0.0.0/8

On Github License

Files

Download PDF of Htaccess file
GET, HTTP_HOST, HTTP_REFERER, POST

Comments

Apache