I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 8029
41131 credits Members referred : 3
« Reply #6 on: Aug 17, 2006, 10:49:03 AM »
You could keep only the domain of the bad referer (eg. forum.donanmhaber.com ) and then do this :
Code:
<?php $badHosts = file ( 'badhosts.txt' ); $ref = parse_url( $_SERVER['HTTP_REFERER'] ); if ( in_array( $ref['host'] . "\n" , $badHosts ))// The \n is because file() leaves a \n character after each record. { //Catch ya :) }
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6301
38632 credits Members referred : 374
It's time to use PHP5!
« Reply #7 on: Aug 17, 2006, 10:53:21 AM »
yes you're right if there are more the one pages on a website with bad links, most of the time its only one, that I look for a longer URL is for me to know if this is the only link...
But maybe this is a nice script for the code gallery...
I love Pokemon
Posts: 14
92 credits Members referred : 0
« Reply #13 on: Sep 10, 2006, 09:01:15 PM »
This looks good but the search term includes a / such that the term "adsense" becomes "/adsense" limiting the search results. You can see that in the example link above http://www.webdigity.com/adsense. The search result is "/adsense" and not just "adsense". I hope the / can be removed from the search term.
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 8029
41131 credits Members referred : 3
« Reply #14 on: Sep 10, 2006, 09:59:11 PM »
Thanks for the heads up geezmo, and BTW welcome to our community
The SMF snippet has been corrected now(check the first post).
I love Pokemon
Posts: 14
92 credits Members referred : 0
« Reply #15 on: Sep 14, 2006, 09:27:53 PM »
My site is at www.mysite.com/forum and when I used the code in the first post, it doesn't redirect to the forum's search page but rather it goes to the main index page. How to solve this?
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 8029
41131 credits Members referred : 3
My site is at www.mysite.com/forum and when I used the code in the first post, it doesn't redirect to the forum's search page but rather it goes to the main index page. How to solve this?
I love Pokemon
Posts: 14
92 credits Members referred : 0
« Reply #17 on: Sep 14, 2006, 09:43:34 PM »
I tried that but what happened was it didn't load.. I got a /forum/forum/forum/forum/forum/index.php... error..
Also, I checked Google Sitemaps and it said it can't verify my site because the 404 error is now being recognized as a 202 page. This caused problem to my Google Sitemaps so I just chose to uninstall this. Now Sitemaps is doing ok again.
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 8029
41131 credits Members referred : 3
« Reply #18 on: Sep 15, 2006, 08:41:10 PM »
To avoid the sitemaps problem (which actually is not a real problem) you can remove this line from the script : header("HTTP/1.0 200");
Now regarding the error you get, can you give some more feedback? Is it a php error or something else? Did you put all the files that mentioned in your forum/ directory?
Thanks. I will propably add this as an additional tutorial and cross link both of them
Are u finished with this?
And other problems that appear is that when page is redirect to the search page, there isnt search results for the word which cause that error and i'm sure that word is posted on the forum for milion times.
« Last Edit: Dec 01, 2006, 11:12:31 AM by Pharmacy »
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3700