Apache/Unix-flavored server:
Create a plain textfile, named .htaccess . The command lines you need will look like the following. The # lines are comments, to remind me what I was doing months down the line.
[code]
# turn on rewrite engine; this line can
# only appears ONCE in this file
#
RewriteEngine on
#
#--------------
# look for the S.O.B. referer or host or referer
# vanguardnewsnetwork resolves to 66.139.76.169
# NC = ignore case (capitals vs lowercase)
# OR = satisfy any condition (host or referer or addy)
#
RewriteCond %{REMOTE_HOST} \.vanguardnewsnetwork\.com [NC,OR]
RewriteCond %{HTTP_REFERER} \.vanguardnewsnetwork\.com [NC,OR]
RewriteCond %{REMOTE_ADDR} ^66\.139\.76\.169
#
#-----------------
# send 'em right back where they came from
#
RewriteRule ^(.*) %{HTTP_REFERER} [R=301,L]
[/code]
— rewrite cond lines = 1 long line per ; this forum wraps ’em —
To test that your syntax is correct (without temporarily killing your site), create /test/ directory. Create an index.html file with one line: OK!, and upload that index file to the /test/ directory. (You can take mine: law4pda.org/test/index.html ). Upload your newly created .htaccss file to /test/ . Most hosts are configured to see index.(extension) as a default. Use your browser to navigate to yourdomain.com/test/ . If you see OK, you’re good to go, and can now place the .htaccess file in your root www directory. If you get a 500 internal server error, recheck the htaccess lines carefully, revise as necessary and retest.