View Full Version : .htaccess question...
TheMrHappy
07-21-2002, 03:13 AM
I need to block some URLs and IPs from accesing my site.
I've found .htaccess files posted on this board, but all old
and the HTML has got totally screwed up :confused:
Any help will be apriciated :)
This is a .htaccess file I am currently using:
AuthUserFile /dev/null
AuthGroupFile /dev/null
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://www.site1.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.site2.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://site1.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://site2.com/ [NC]
RewriteRule /* http://www.site.com/ [R,L]
ErrorDocument 404 http://www.site.com/
ErrorDocument 403 http://www.site.com/
Options -Indexes
What this basically does is redirect all 404, 403, and any person browsing a directory on your webserver, gets redirected to http://www.site.com. And any access from any other site that is different from site1.com or site2.com gets redirected to www.site.com.
Sorry I suck at describing things, but hope you get the jist of it.
TheMrHappy
07-21-2002, 12:14 PM
Thanks Evo, but as I understand your explanation this .htaccess will block everything except site1.com and site2.com
What I need is an .htaccess file which will allow everything except few specific addresses.
Let's say I want all hits coming from:
www.blah-blah.com
154.768.98.98
www.boom-boom.com
to be redirected to www.pop-up.com and hits coming from everywhere else to be able to get in.
Binghiman
07-21-2002, 12:22 PM
Then just change the [NC] flag to [OR] flag
investigator
07-21-2002, 01:02 PM
http://www.sponsorpost.com/resources/passguard/
And do watch out for that host using your Credit card to shop:
fiberlocity.com
vBulletin® v3.7.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.