Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

.htaccess domain blocking error

 
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Next:  How to restore COM+ System Application Service?  
Author Message
user3412

External


Since: Jan 10, 2005
Posts: 5



(Msg. 1) Posted: Mon Jan 10, 2005 8:35 am
Post subject: .htaccess domain blocking error
Archived from groups: alt>www>webmaster (more info?)

I tried adding this at the top of my .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_REFERER} badsite.com [OR,NC]
RewriteCond %{HTTP_REFERER} otherbadsite.com [OR,NC]
RewriteCond %{HTTP_REFERER} thirdbadsite.com [NC]
RewriteRule .*\.(gif|jpg|swf|png)$ - [NC,F]

But then I receive this error when I try to visit my site:
Forbidden. You don't have permission to access / on this server.
Additionally, a 403 Forbidden error was encountered while trying
to use an ErrorDocument to handle the request.
-------
Apache/1.3.27"

What am I doing wrong?

 >> Stay informed about: .htaccess domain blocking error 
Back to top
Login to vote
usenet

External


Since: Sep 14, 2004
Posts: 1119



(Msg. 2) Posted: Mon Jan 10, 2005 9:35 am
Post subject: Re: .htaccess domain blocking error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

John wrote:
 > I tried adding this at the top of my .htaccess file:
 >
 > RewriteEngine On
 > RewriteCond %{HTTP_REFERER} badsite.com [OR,NC]
 > RewriteCond %{HTTP_REFERER} otherbadsite.com [OR,NC]
 > RewriteCond %{HTTP_REFERER} thirdbadsite.com [NC]
 > RewriteRule .*\.(gif|jpg|swf|png)$ - [NC,F]

I'm not sure what you are doing wrong, but the group FAQ suggests that
you use:

--- start ---
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$ [NC]
RewriteRule .*\.gif$ - [F]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$ [NC]
RewriteRule .*\.jpg$ - [F]
--- end ---

to stop image linking from any site other than your own. It appears to
be only a matter of adding in a couple more rules to cover swf and png
images.

Looking at your rules, do you really want to ban image linking from just
those three "bad sites" or would banning from *all* other sites be good
enough?

--
Dylan Parry
<a style='text-decoration: underline;' href="http://webpageworkshop.co.uk" target="_blank">http://webpageworkshop.co.uk</a> -- FREE Web tutorials and references<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: .htaccess domain blocking error 
Back to top
Login to vote
user3412

External


Since: Jan 10, 2005
Posts: 5



(Msg. 3) Posted: Mon Jan 10, 2005 11:35 am
Post subject: Re: .htaccess domain blocking error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I only want to block a few bad sites, but tried I the block-everybody
example you suggested anyway. I received the same error again.
 >> Stay informed about: .htaccess domain blocking error 
Back to top
Login to vote
user3412

External


Since: Jan 10, 2005
Posts: 5



(Msg. 4) Posted: Mon Jan 10, 2005 11:35 am
Post subject: Re: .htaccess domain blocking error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I only want to block a few bad sites, but I tried the block-everybody
example you suggested anyway. I received the same error again.
 >> Stay informed about: .htaccess domain blocking error 
Back to top
Login to vote
comments

External


Since: Sep 14, 2004
Posts: 1625



(Msg. 5) Posted: Mon Jan 10, 2005 1:35 pm
Post subject: Re: .htaccess domain blocking error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Once upon a time, far far away, the king summoned "John" <_> who
replied:

 >I only want to block a few bad sites, but tried I the block-everybody
 >example you suggested anyway. I received the same error again.
 >

What you are doing, if successful, will block every reader who has
immediately previously viewed a page at one of those domains. Are you
sure you want to do that?

Matt

--
Free, high quality content for web sites. See
<a style='text-decoration: underline;' href="http://www.probertencyclopaedia.com/xcont.htm" target="_blank">http://www.probertencyclopaedia.com/xcont.htm</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: .htaccess domain blocking error 
Back to top
Login to vote
user3412

External


Since: Jan 10, 2005
Posts: 5



(Msg. 6) Posted: Mon Jan 10, 2005 2:35 pm
Post subject: Re: .htaccess domain blocking error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I contacted support, and they told me to add this as the first line
Options +SymlinksIfOwnerMatch
and now it works fine.

 > What you are doing, if successful, will block every reader who has
 > immediately previously viewed a page at one of those domains. Are you
 > sure you want to do that?

I am blocking a fes crack sites, and on top of that, I made one for
downloads (exe-files) too, that redirect them to download a virus. Ok, not
to a virus, but I was tempted Smile<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: .htaccess domain blocking error 
Back to top
Login to vote
usenet200501

External


Since: Jan 02, 2005
Posts: 74



(Msg. 7) Posted: Mon Jan 10, 2005 2:35 pm
Post subject: Re: .htaccess domain blocking error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

John wrote:

 > Forbidden. You don't have permission to access / on this server.
 > Additionally, a 403 Forbidden error was encountered while trying
 > to use an ErrorDocument to handle the request.

chmod 644 .htaccess

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ <a style='text-decoration: underline;' href="http://tobyinkster.co.uk/contact" target="_blank">http://tobyinkster.co.uk/contact</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: .htaccess domain blocking error 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
.htaccess causing unwanted 403 error - I have been using .htaccess to prevent hotlinking of images from my site and it works well. However, I am switching to a new host (a dedicated server) and when I upload the file in the httpdocs directory (named /html) I get a 403 error trying to access..

blocking traffic.... - Hey is there an easy way to block traffic to your site when it comes from another site you dont want traffic from? Say abc.com has a link to xyz.com and is sending traffic you dont want. Can xyz.com redirect that traffic to a different URL?

ip range blocking/iis - hi, im running my sites off my home dsl connection on a win2k server box with iis 5.0. im getting unwanted attention from various ip's in the 152.6.0.0-152.6.255.255 range and would like to block the entire range from access to my websites. on the &quo...

IP blocking on web site - I have a form entry where anonymous people can post comments. I assume there is a way I can have it log their IP address when they post through the form. If I ban a particular IP address, what are the odds that I will ban someone else who is innocent. I....

Norton Antivirus blocking ads - As a lot of you are probably aware by now, Norton Internet Security is blocking ads, images and links from web sites that link to affiliate web sites. This is criminal! Defacing web sites! I have made a banner on one of my web sites ..
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]