IPB
Your FREE membership includes:
  • A friendly community where you can come to chat
  • Receive completely FREE quality web hosting!
  • Get reviews and suggestions for your websites!
  • Take part in competitions where you can win prizes from cash, vouchers, or win special unadvertised hosting

Welcome Guest ( Log In | Register )


Shortcut links:
Like this topic? Digg it... Digg this topic · Save to del.icio.us · Slashdot It · Post to Technorati · Post to Furl · Submit to Reddit · Share on Facebook · Fark It · Googlize This Post · Add to ma.gnolia · Tag to Wink · Add to MyWeb · Add to Netscape
 
Reply to this topicStart new topic
> ban visitors comming from a certain site?, not banning the ip address, just to ban peeps comming from a site.
ashdkiawhr
post Dec 15 2007, 12:15 PM
Post #1


Starter Member
Group Icon

Group: Members
Posts: 140
Joined: 11-March 07
Member No.: 750



Anyone knows how can I block visitors coming to my site from another website which linked my site?

There's a site that put link of my site without my permission and some visitors are coming to my site from it.

How can I block that, besides blocking these visitor's ip addresses?


--------------------
IPB Image
Go to the top of the page
 
+Quote Post
Firefox
post Dec 18 2007, 11:46 PM
Post #2



Group Icon

Group: Admin
Posts: 836
Joined: 8-October 06
Member No.: 48



I'm suprised no one has answered this.

In PHP you can do this:

CODE
<?
if (strstr($_SERVER["HTTP_REFERER"], "http://websiteyouhate.com") != false)
{
header("location:http://www.websiteofyourchoice.com");
}
?>


Stick this code RIGHT at the top of the page (no white spaces or empty lines ANYWHERE before it)

This will check if visitors are coming from the website you dont like, and will 301/302 redirect them to another website of your choice... you can see the uses biggrin.gif

Although if the website that links to you has any SEO technical savvy, they can lower your Google rankings if you do this (not explaining how). In that case, use a javascript redirect in place of that "header(...)" line


--------------------
The Free cPanel Host and GrandForums Main Administrator. Sign-up FREE Now!
Go to the top of the page
 
+Quote Post
Forte
post Dec 19 2007, 03:12 AM
Post #3


Professional
Group Icon

Group: Advertising Team
Posts: 603
Joined: 11-February 07
From: Over there.
Member No.: 701



Very interesting code... That may come in handy one day for various things.

I would have answered this if I knew any ways to do it other than go by the site who's linking to you and ask nicely for them to take the link off tongue.gif


--------------------
Go to the top of the page
 
+Quote Post
javayahtzee
post Jan 17 2008, 07:44 AM
Post #4


Professional
Group Icon

Group: Members
Posts: 539
Joined: 20-October 07
Member No.: 1199



Of course, I wonder why you don't want people coming to your site from that site smile.gif
I get all the traffic I can smile.gif
anyway... I would have just done it with javascript but this php script is nice!


--------------------
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are browsing this forum (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No new  
29 thegrrl 1077 11th September 2008 - 10:22 PM
Last post by: taytersalad
No new  
14 thegrrl 734 12th May 2008 - 06:04 PM
Last post by: reiika51
No New Posts  
12 thegrrl 534 28th November 2008 - 09:17 AM
Last post by: danta
No new  
18 Designz 1194 26th September 2007 - 05:09 AM
Last post by: gmnerd
No New Posts  
10 dudeno 706 24th September 2007 - 08:21 AM
Last post by: ntw



© GrandForums.com