Error accessing Website

ogah

New member
cPanel User Name: ddlgen
Name of Domain: ddlgen.net
Detailed Description: i have problem with my site, my hompage can not be access with one of internet provider in my country. but some files can accessed with same provider.
if i connect the internet with proxy i can access my site, but sometime the webpage come from cloudflare cache that say my site is down.

i not found any problem if i connect the internet with other provider.

i want to know the problem come from my internet provider, from my server or both?
if error from my server or my script, how to solve it?

thanks
regards
ogah
Additional Information: this is screen shot when my site error
error.gif

 

ogah

New member
i am from indonesia IG.
my website can not accessed with XL, but other provider from indonesia can access my website.
but XL with proxy can access my website
 

GigaGreg

Moderator
Staff member
Hmm thats strange, It looks like your ISP. But I cannot provide you technical information. Tech admin might help you.
 

Genesis

Administrator
Staff member
I also don't have problems with accessing your site Ogah. It downloads very fast as well.

Have you purged your Cloudflare cache? I have a feeling it has something to do with Cloudflare. You need to clear out the cache.

https://support.cloudflare.com/hc/en-us/articles/200169246-How-do-I-purge-my-cache-

Maybe you should flush your own cache as well.

CMD>ipconfig/flushdns

If it still has issues, disable Cloudflare and see whether that makes a difference.

I also found this report connected with Cloudflare - see whether this may be helpful:
https://support.cloudflare.com/hc/en-us/articles/200172506-My-website-is-offline-or-unavailable-
 

ogah

New member
yesterday i pause the cloudflare and get error 503 (using XL provider).
but with XL i can access my view.php and edit.php file.

before using cloudflare i use google page speed. i move dns to cloudflare because i get that error and hope with cloudflare my problem will solved. and i still get that error.
 

Genesis

Administrator
Staff member
I'll check some more after work today. Must be something in your configuration. Like using the medicine - cloudflare - to fix something and that medicine requiring something else to be reconfigured otherwise x,y.z happens.
 

ogah

New member
i have found the file that make error in my site
this is my problem file
PHP:
<?php
if(isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
	$badip = $_SERVER['HTTP_CF_CONNECTING_IP'];
}
elseif(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
	$badipo = explode(',', str_replace(' ', '', $_SERVER['HTTP_X_FORWARDED_FOR']));
	$badip = $badipo[0];
}
else {
	$badip = $_SERVER['REMOTE_ADDR'];
}

$badlist = file('bad.txt');
$badlist = preg_replace('/\n|\r/', '', $badlist);
$cekhost = gethostbyaddr($badip);

foreach($badlist as $bad) {
	$bad = str_replace('.', '\.', $bad);
	$cocok = '/'.$bad.'/';
	if(preg_match($cocok, $cekhost)) {
		$gdetectedi = 'grab';
	}
}

if(preg_match('/PHP/', $_SERVER['HTTP_USER_AGENT'])) {
 	$gdetectedi = 'grab'; 
}

if(isset($_SERVER["CONTENT_TYPE"]) AND $_SERVER["CONTENT_TYPE"] == 'application/x-www-form-urlencoded') {
 	$gdetectedi = 'grab'; 
}

?>
and this is my bad.txt
Code:
72.233.72.155
50.23.201.229
5.9.61.150
100tb
88.190.19.155
5.135.18.46
vps
res.rr
tedata
hosting
hostgator
proxad
hawk
bluehost
hostingprod
SteepHost
subdomain
Eqservers
gae
xlhost
kimsufi
onlinehome
vpnbook
leaseweb
localhost
webhost
colo
proxy
your-server
softlayer
163data
autoddl
contegix
2.181.19.33
95.154.230.191
66.90.
gidnetwork
w3.org
utel.net.ua
online333
fastwebserver
subdomain
oroxy
spem
webtropia
mancos
redstation
yolau
65.49.14.162
68.68.96.
89.165.111.44
41.102.21.118
123.28.14.74
198.50.242.15
119.30.42.239
37.59.250.
31.170.


i don't know why this script can make my site not accessable with my ISP
 

jaran

New member
Try this method,
PHP:
// The blacklisted ips.
$denied_ips = array(
'1.2.3.4',
'2.3.*',
);

// The function to get the visitor's IP.
function getUserIP(){
    //check ip from cloudflare
    if (!empty($_SERVER['HTTP_CF_CONNECTING_IP'])){
      $ip=$_SERVER['HTTP_CF_CONNECTING_IP'];
    }
    //to check ip is pass from proxy
    elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
      $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
    } else {
      $ip=$_SERVER['REMOTE_ADDR'];
    }
    return $ip;
}
//The user
$visitorIp = getUserIP();

// Now let's search if this IP is blackliated
$status = array_search($visitorIp, $denied_ips);

// Let's check if $status has a true OR false value.
if($status !== false){
    echo '<div class="error">Your IP has been banned! Stop spamming us!</div>';
    // header("Location: http://domain.com");
    // exit; 
}
 

ogah

New member
jaran said:
Try this method,
PHP:
// The blacklisted ips.
$denied_ips = array(
'1.2.3.4',
'2.3.*',
);

// The function to get the visitor's IP.
function getUserIP(){
    //check ip from cloudflare
    if (!empty($_SERVER['HTTP_CF_CONNECTING_IP'])){
      $ip=$_SERVER['HTTP_CF_CONNECTING_IP'];
    }
    //to check ip is pass from proxy
    elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
      $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
    } else {
      $ip=$_SERVER['REMOTE_ADDR'];
    }
    return $ip;
}
//The user
$visitorIp = getUserIP();

// Now let's search if this IP is blackliated
$status = array_search($visitorIp, $denied_ips);

// Let's check if $status has a true OR false value.
if($status !== false){
    echo '<div class="error">Your IP has been banned! Stop spamming us!</div>';
    // header("Location: http://domain.com");
    // exit; 
}

thanks bro.
i want make spam blocker based on IPs hostname, so if the different IP range have same appart name will be blocked (so we dont need to include all range with same hostname). in my list some is IP because they dont have reverse hostname.

you also from indonesia.
you can try your script with big array, and try accessing your script with XL, maybe you will get error like me.
 

whsecurity

New member
I don't know if it is you or someone hacked your account! 1 at three times a hit your url it will redirect me to an advertisement! Also sometimes your website have a slow load speed like something loads underneath...