Affiliate Marketing
Forum Search


Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 04-04-08
Bud's Avatar
Bud Bud is online now
Registered User
 
Join Date: Nov 2006
Posts: 506
Thanks: 10
Thanked 6 Times in 4 Posts
Bud seems to know their stuff
  Block a site from accessing mine

Is it possible to block a site accessing pages on my site?

ie. in my logs I see a site, let's call it: dodgysite.com

and I see that it regularly accesses my site using the url: dodgysite.com/trawlandrob.php


Can I block dodgysite.com from accessing information?

I know I can block an IP but can I block a url?

Thanks
__________________
Bud

Great Shopping That Doesn't Cost The Earth: www.TheOffsetShop.co.uk
"Will Dance for Discount Codes!"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-04-08
tbp tbp is online now
Registered User
 
Join Date: Dec 2006
Posts: 1,917
Thanks: 0
Thanked 10 Times in 10 Posts
tbp is an unknown quantity at this point
  Re: Block a site from accessing mine

Yes, could do it through PHP. The page referrer if it exists is held in $_SERVER['HTTP_REFERER']

So you could use the following:

Code:
if(substr_count($_SERVER['HTTP_REFERER'],"dodgysite.com") > 0){
  header("Location: you_cant_view_this_site.php");
}
It would be better to do it at the web server level, but you probably won't be able to access the apache config. If you can you can do it using mod_rewrite.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-04-08
Registered User
 
Join Date: Mar 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
affMonkey is an unknown quantity at this point
  Re: Block a site from accessing mine

yes it is possible and it can be done with a .htaccess file - see here Bud
__________________
Band, Music T-shirts & Hoodies
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-04-08
tbp tbp is online now
Registered User
 
Join Date: Dec 2006
Posts: 1,917
Thanks: 0
Thanked 10 Times in 10 Posts
tbp is an unknown quantity at this point
  Re: Block a site from accessing mine

Quote:
yes it is possible and it can be done with a .htaccess file
The only problem with that is that quite a few hosting accounts don't allow .htaccess files, or lock it down to provide password protection only.

It is the best way to do it for sure, but the PHP way has the advantage that it will work on any account.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-04-08
Bud's Avatar
Bud Bud is online now
Registered User
 
Join Date: Nov 2006
Posts: 506
Thanks: 10
Thanked 6 Times in 4 Posts
Bud seems to know their stuff
  Re: Block a site from accessing mine

Thanks both.

I think that's sorted it - I'll keep an eye on my stats just to make sure I've got it right.

Appreciated
__________________
Bud

Great Shopping That Doesn't Cost The Earth: www.TheOffsetShop.co.uk
"Will Dance for Discount Codes!"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-04-08
Registered User
 
Join Date: Mar 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
affMonkey is an unknown quantity at this point
  Re: Block a site from accessing mine

Quote:
Originally Posted by tbp View Post
The only problem with that is that quite a few hosting accounts don't allow .htaccess files, or lock it down to provide password protection anyway.
ok kool I did not know that, thanks for pointing it out tbp
__________________
Band, Music T-shirts & Hoodies
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
SEO - Thinking aloud ... how do search engines index the site? hrbs Search Engine Strategies 28 13-09-07 10:37 AM
My Keyword Research - Care to contribute to the research? webdesignhq Search Engine Strategies 4 26-03-07 09:52 AM
Problems accessing this site mattylamb The Affiliate Marketing Lounge 6 08-11-05 11:18 PM
Astrobingo Player testimonials jess1 Commission Junction - CJ UK 0 24-08-05 07:05 PM
Negative Site Feedback bulbo The Affiliate Marketing Lounge 37 15-05-04 06:39 PM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7