Forum Moderators: open
Host: 23.20.22.2
/
Http Code: 403 Date: Jun 18 08:47:55 Http Version: HTTP/1.0 Size in Bytes: 13
Referer: -
Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
IP: 23.20.22.2
Hostname: ec2-23-20-22-2.compute-1.amazonaws.com
ISP: Amazon.com
Organization: Amazon.com
Services: None detected
Type: Corporate
Assignment: Static IP
Country: United States
State/Region: Virginia
City: Ashburn
RewriteCond %{HTTP_USER_AGENT} Googlebot
RewriteCond %{REMOTE_ADDR} !^(66\.249|74\.125)\.
RewriteRule (^|\.html|/|\.pdf)$ - [F]
Lucy suggested:
RewriteCond %{HTTP_USER_AGENT} Googlebot
RewriteCond %{REMOTE_ADDR} !^(66\.249|74\.125)\.
RewriteRule (^|\.html|/|\.pdf)$ - [F]
Options +FollowSymLinks
RewriteEngine On
# BLOCK IPs
order allow,deny
deny from 128.204.195.249
deny from 173.213.
. . . . . . . . .
allow from all
# BLOCK USER AGENTS:
SetEnvIfNoCase User-Agent (\<|\>|\'|\$x0|\%0A|\%0D|\%27|\%3C|\<) ban
SetEnvIfNoCase User-Agent (a6corp|MJ12bot|YisouS|NerdyBot|nutch|spbot) ban
. . . . . . . . .
Order Allow,Deny
Allow from all
Deny from env=ban
# REDIRECT
Redirect 301 /example1.html /example2.html
# BLOCK COUNTRY DOMAINS
RewriteCond %{HTTP_REFERER} \.(ru|su|ua|cn|md|kz|pl|lv|ro)(/|$) [NC,OR]
RewriteCond %{HTTP_REFERER} \.(by|bg|hr|cz|al|rs|kp|hu|jp)(/|$) [NC]
RewriteRule (^|\.html|/)$ - [F]
# BLOCK REFERERS
RewriteCond %{HTTP_REFERER} (formatn|kochanelli|chimiver|poker|thepostemail) [NC,OR]
RewriteCond %{HTTP_REFERER} (sugarkun|trustcombat|escort|letseks|tipkiller) [NC,OR]
RewriteCond %{HTTP_REFERER} (semalt|#*$!ogorod\.com|prostitutki) [NC]
RewriteRule (^|\.html|/)$ - [F]
# BLOCK HOME PAGE FROM SELF-REFERERS
RewriteCond %{HTTP_REFERER} ^http://(www\.)?example\.com(/(index\.html)?)?$ [NC]
RewriteRule ^(index\.html)?$ - [F]
# REWRITE TO WWW
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
# PREVENT INDEXING OF IMAGES
<Files ~ "\.(gif|jp[eg]|png)$">
Header append x-robots-tag "noindex"
</Files>
ErrorDocument 403 "Access Denied"
ErrorDocument 404 /custom404.html
# END
Redirect 301 /example1.html /example2.html
<snip>
RewriteCond
Lucy wrote:
Aaack, don't do that! Don't combine mod_alias (Redirect by that name) with mod_rewrite; things won't execute in the desired order. Anything currently using mod_alias should be converted to mod_rewrite syntax, and then put it with the other redirects (R=301 flag).
So a one-line 301 redirect (mod_alias) should never be included in an .htaccess file that also includes mod_rewrite instructions?
self-proclaimed experts
Once I copied some recommended code from some article somewhere, and it caused an internal server error!
Host: 183.217.178.17
/
Http Code: 200 Date: Jun 20 19:34:16 Http Version: HTTP/1.1 Size in Bytes: 43733
Referer: http://www.example.com//RK=0
Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36
Host: 86.51.26.22
//RK=0
Http Code: 404 Date: Jun 20 19:33:41 Http Version: HTTP/1.0 Size in Bytes: 472
Referer: http://www.example.com/
Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36
allinurl: RS "//RK=0"it looks like someone figured out what these come from: scraped pages of malformed URLs from results of Yahoo searches. If we want to discuss a problem that is a different topic, it helps others find the information if we keep it all together with the rest of that discussion: [webmasterworld.com...]
# change . to \.
# ^(Redirect \d\d\d \S+?[^\\])\. TO \1\\.
# now change Redirect to Rewrite
# ^Redirect(?:Match)? 301 /(.+) TO RewriteRule \1 [R=301,L]