Iwahai - A bit of help coding please - coding problem

Hey Guys…I’ve got the following on my server as a redirect for when someone shares a marker on Iwahai - but it’s only working on my ipad - not on iphone. Iphone just sends it to a 404 page. What am I doing wrong here? Please help.

   <?php

echo "Redirecting..";

$iPod    = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone  = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad    = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
$Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android");
$webOS   = stripos($_SERVER['HTTP_USER_AGENT'],"webOS");

//do something with this information
if($iPhone){
    header("Location: https://itunes.apple.com/us/app/iwahai/id1441200141?mt=8");
    //browser reported as an iPhone -- do something here
    
}else if($Pad){
    header("Location: https://itunes.apple.com/us/app/iwahai/id1441200141?mt=8");//browser reported as an iPad -- do something here
    
}else if($iPod){
    header("Location: https://itunes.apple.com/us/app/iwahai/id1441200141?mt=8");
    //browser reported as an iPod Touch -- do something here

}else if($Android){
    header("Location: https://play.google.com/store/apps/details?id=com.iwahai");
    //browser reported as an Android device -- do something here
}else {
    header("Location: https://iwahai.com");
}


/* Make sure that code below does not get executed when we redirect. */
exit;
?>
3 Likes

What do your webserver logs look like when you are trying to access this page from your phone?

3 Likes

OMG. Welcome back! It’s been a hot minute!

2 Likes

209.17.96.58 - - [31/Jul/2019:08:48:33 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)”

209.17.96.202 - - [31/Jul/2019:21:47:14 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)”

54.36.148.95 - - [01/Aug/2019:06:45:36 -0400] “GET /robots.txt HTTP/1.1” 500 672 “-” “Mozilla/5.0 (compatible; AhrefsBot/6.1; +http://ahrefs.com/robot/)”

209.17.96.26 - - [02/Aug/2019:13:41:57 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)”

209.17.96.194 - - [03/Aug/2019:02:19:06 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)”

60.191.38.77 - - [03/Aug/2019:10:44:59 -0400] “GET / HTTP/1.1” 200 2096 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

60.191.38.77 - - [03/Aug/2019:13:44:45 -0400] “GET / HTTP/1.1” 200 2096 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

60.191.38.77 - - [06/Aug/2019:03:18:33 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

209.17.97.18 - - [06/Aug/2019:09:37:56 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)”

60.191.38.77 - - [06/Aug/2019:18:01:48 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

60.191.38.77 - - [06/Aug/2019:19:47:35 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

209.17.96.34 - - [07/Aug/2019:02:42:26 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)”

209.17.97.2 - - [07/Aug/2019:08:33:00 -0400] “GET / HTTP/1.1” 200 2096 “-” “Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)”

209.17.96.10 - - [08/Aug/2019:21:17:11 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)”

60.191.38.77 - - [10/Aug/2019:04:38:40 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

60.191.38.77 - - [10/Aug/2019:05:26:16 -0400] “GET / HTTP/1.1” 200 2096 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

60.191.38.77 - - [12/Aug/2019:17:59:41 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

60.191.38.77 - - [13/Aug/2019:05:29:56 -0400] “GET / HTTP/1.1” 200 2096 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

60.191.38.77 - - [13/Aug/2019:05:42:15 -0400] “GET / HTTP/1.1” 200 2096 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

209.17.96.66 - - [13/Aug/2019:07:47:13 -0400] “GET / HTTP/1.1” 200 2096 “-” “Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)”

209.17.96.50 - - [15/Aug/2019:19:13:33 -0400] “GET / HTTP/1.1” 200 2096 “-” “Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)”

60.191.38.77 - - [16/Aug/2019:17:53:03 -0400] “GET / HTTP/1.1” 200 2096 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

60.191.38.77 - - [16/Aug/2019:18:34:23 -0400] “GET / HTTP/1.1” 200 2096 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

60.191.38.77 - - [19/Aug/2019:07:44:01 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

60.191.38.77 - - [19/Aug/2019:21:47:58 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

60.191.38.77 - - [20/Aug/2019:00:31:10 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

209.17.96.146 - - [21/Aug/2019:01:03:27 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)”

3 Likes

Firefox/47.0"

60.191.38.77 - - [06/Aug/2019:03:09:58 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

54.36.148.57 - - [06/Aug/2019:06:29:49 -0400] “GET /robots.txt HTTP/1.1” 500 672 “-” “Mozilla/5.0 (compatible; AhrefsBot/6.1; +http://ahrefs.com/robot/)”

185.222.57.131 - - [06/Aug/2019:16:12:38 -0400] “GET ///wp-admin/install.php HTTP/1.1” 500 672 “-” “Python-urllib/2.7”

185.222.57.131 - - [06/Aug/2019:16:12:41 -0400] “GET //wp/wp-admin/install.php HTTP/1.1” 500 672 “-” “Python-urllib/2.7”

185.222.57.131 - - [06/Aug/2019:16:12:44 -0400] “GET //wordpress/wp-admin/install.php HTTP/1.1” 500 672 “-” “Python-urllib/2.7”

185.222.57.131 - - [06/Aug/2019:16:12:47 -0400] “GET //blog/wp-admin/install.php HTTP/1.1” 500 672 “-” “Python-urllib/2.7”

185.222.57.131 - - [06/Aug/2019:16:12:51 -0400] “GET //old/wp-admin/install.php HTTP/1.1” 500 672 “-” “Python-urllib/2.7”

185.222.57.131 - - [06/Aug/2019:16:12:55 -0400] “GET //new/wp-admin/install.php HTTP/1.1” 500 672 “-” “Python-urllib/2.7”

185.222.57.131 - - [06/Aug/2019:16:12:57 -0400] “GET //oldsite/wp-admin/install.php HTTP/1.1” 500 672 “-” “Python-urllib/2.7”

185.222.57.131 - - [06/Aug/2019:16:13:00 -0400] “GET //web/wp-admin/install.php HTTP/1.1” 500 672 “-” “Python-urllib/2.7”

185.222.57.131 - - [06/Aug/2019:16:13:02 -0400] “GET //home/wp-admin/install.php HTTP/1.1” 500 672 “-” “Python-urllib/2.7”

60.191.38.77 - - [06/Aug/2019:19:47:34 -0400] “GET / HTTP/1.1” 301 227 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

209.17.96.18 - - [09/Aug/2019:13:25:28 -0400] “GET / HTTP/1.1” 301 227 “-” “Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)”

60.191.38.77 - - [10/Aug/2019:04:38:34 -0400] “GET / HTTP/1.1” 301 231 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

94.177.232.220 - - [10/Aug/2019:17:14:34 -0400] “GET / HTTP/1.1” 200 558 “-” “python-requests/2.10.0”

94.177.232.220 - - [10/Aug/2019:17:15:16 -0400] “GET /language/en-GB/en-GB.ini HTTP/1.1” 500 672 “-” “python-requests/2.10.0”

60.191.38.77 - - [12/Aug/2019:18:50:08 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

209.17.97.74 - - [13/Aug/2019:00:46:27 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)”

60.191.38.77 - - [13/Aug/2019:05:29:48 -0400] “GET / HTTP/1.1” 301 227 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

209.17.96.106 - - [16/Aug/2019:08:03:50 -0400] “GET / HTTP/1.1” 200 2096 “-” “Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)”

60.191.38.77 - - [16/Aug/2019:18:34:08 -0400] “GET / HTTP/1.1” 301 231 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

134.119.221.30 - - [18/Aug/2019:16:47:30 -0400] “GET /xmlrpc.php?rsd HTTP/1.1” 500 672 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36”

134.119.221.30 - - [18/Aug/2019:16:47:31 -0400] “GET / HTTP/1.1” 200 2096 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36”

134.119.221.30 - - [18/Aug/2019:16:47:31 -0400] “GET /blog/wp-includes/wlwmanifest.xml HTTP/1.1” 500 672 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36”

134.119.221.30 - - [18/Aug/2019:16:47:31 -0400] “GET /wordpress/wp-includes/wlwmanifest.xml HTTP/1.1” 500 672 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36”

134.119.221.30 - - [18/Aug/2019:16:47:32 -0400] “GET /wp/wp-includes/wlwmanifest.xml HTTP/1.1” 500 672 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36”

134.119.221.30 - - [18/Aug/2019:16:47:32 -0400] “GET /site/wp-includes/wlwmanifest.xml HTTP/1.1” 500 672 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36”

134.119.221.30 - - [18/Aug/2019:16:47:32 -0400] “GET /cms/wp-includes/wlwmanifest.xml HTTP/1.1” 500 672 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36”

60.191.38.77 - - [19/Aug/2019:08:33:32 -0400] “GET / HTTP/1.1” 200 2273 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

60.191.38.77 - - [20/Aug/2019:00:31:03 -0400] “GET / HTTP/1.1” 301 227 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0”

3 Likes

I keep a finger on the pulse here @peter, and I thought this was somewhere I could help today. BTW I am still slow stacking my crypto.

2 Likes

Have you set up any other type of logging to capture what user-agent is being reported? even just a print line to show the user-agent at the top of the page for testing can let you know what the system is seeing.

2 Likes

I have not. I need to do that.

3 Likes

Further as I have been thinking about this problem I would say look into a switch statement instead of the if else block. instead of assigning the variable and then doing compares you bring in the http_user_agent and then when it matches the case it executes that code.

1 Like

how did user agent testing go?

1 Like

It seems to be mainly a problem with the way that firebase is making links - the user agent testing helped to point me in the right direction. Thank you.

2 Likes

Glad you have a path to keep working on. If you need any more help just let me know.

1 Like

Just wanted to update you guys. I’ve updated the Iwahai website - which was a long time coming AND…

Launched the free web map where you can go checkout public markers people have left. You need the app to create markers, share them, look at private markers -

But the markers on the public map are point and click to hear

https://www.iwahai.com - Revised website with news, about, and more

https://map.iwahai.com - public map on the web

1 Like

💰 YEN · DCTV ·️ Bitcoin Lambo · 10 Days of Bitcoin ·️ CEO's Brainpan 🧠