bartonlp/granbyrotary/master/.htaccess - Htaccess File

bartonlp/granbyrotary/master/.htaccess

# Allow CORS
Header set Access-Control-Allow-Origin "*"

# BEGIN EXPIRES
<IfModule mod_expires.c>
    ExpiresActive On
<Files *.php>
  ExpiresByType text/html A0
</Files>
  ExpiresDefault "access plus 10 days"
  ExpiresByType text/javascript "access plus 1 days"
  ExpiresByType text/css "access plus 1 week"
  ExpiresByType text/plain "access plus 1 month"
  ExpiresByType image/gif "access plus 1 month"
  ExpiresByType image/png "access plus 1 month"
  ExpiresByType image/jpeg "access plus 1 month"
  ExpiresByType application/x-javascript "access plus 1 days"
  ExpiresByType application/javascript "access plus 1 days"
  ExpiresByType application/x-icon "access plus 1 year"
</IfModule>
# END EXPIRES

# disable magic quotes. They almost always cause problems!
# does not work on vps12660.inmotionhosting.com
#php_flag magic_quotes_gpc Off

# Turn on rewrite
RewriteEngine on

# Don't allow these robots
RewriteCond %{HTTP_USER_AGENT} "sogou|semrushbot|feedburner|ahrefsbot|baiduspider|ezooms|yandex.com" [NC]
RewriteRule ^.*$ http://bartonlp.com/html/badbot.php [R,L]

RewriteRule ^$ index.php [L]
RewriteRule ^rssfeed.xml    articles/createrss.php [L]
# Rewrite for articles
RewriteRule ^articles/article.(d+)  articles/article.php?article=$1 [L]
RewriteRule ^rotary.css css/rotary.css [L]
RewriteRule ^robots.txt$ robots.php [L,NC]
RewriteRule ^Sitemap.xml$ sitemap.php [L,NC]

# START of block logic
# blocked ip addresses. Add each IP. All but the last should have the [OR] flag. The last one should not have it.
# RewriteCond %{REMOTE_HOST} ^67.40.37.187 [OR] # This is my ip address at 12/10/2009 it may change
#<blocked ip addresses start>
#RewriteCond %{REMOTE_HOST} ^90.157.48.55
#<blocked ip addresses end>
#RewriteRule .* blocked.php [L]
# END of block logic

On Github License

Files

Download PDF of Htaccess file
HTTP_USER_AGENT, REMOTE_HOST

Comments

Apache