Let's make this life Easy, as well as you can
Mengulas berbagai cerita kehidupan mulai dari tradisi hingga teknologi, tips, solusi, informasi, internet, pekerjaan, hiburan, Kesehatan, mitos, fakta, klenik, unik bahkan mistik yang diulas berdasarkan pengalaman serta dari berbagai referensi, semoga bermanfaat
For the publisher, some of mobile browser is able to block the ads on your blog or webpage, thats why the publisher lost their earnings a lot, specialy if all of the visitor who come to your blog used UCBrowser user-agent.

How to solve this problem?

However, i don't want to lost my visitor event they used UCBrowser so then I make a script to tell the visitor to use different mobile browser to read the full article.

How to redirect page if user used UCBrowserWith this script, user who use UCBrowser on theiy mobile devices able to open or read my article on the blog, but after 30 sec the page will changed (not redirect) by the alert or notes to tell to the user to used different mobile browser for the full article.

How to redirect page if user used UCBrowser user-agent

UCBrowser will block or hide your ads, so that why people say they user-agent is the fastest mobile browser.
To make all visitors who use UCBrowser redirected to another page, you can use the following script

<script>if (navigator.userAgent.match(/UCBrowser/i)) {
location.href("http://www.yourdestinationurl.com");
}
</script>

But, how to make redirect all page to one page in same domain on UCBrowser?
In this case you have to write some or part of the url destination, see at the example below :

JavaScript

Target page : http://yourdomain.com/my-redirect-page.html, Then if you want to redirect all page to one page, but don't do this at the target page, use this script :
<script>
if (navigator.userAgent.match(/UCBrowser/i)) {
if (window.location.href.indexOf('my-redirect-page.html') > -1){ // do nothing  
} else {
location.href("http://www.yourdestinationurl.com"); }
}
</script>

Now, how to Redirect Page if visitor used UCBrowser by PHP script

Simple way...

<?php
if(preg_match("/UCBrowser/i",$_SERVER["HTTP_USER_AGENT"])) {
   header('Location:yourpage.php');
   exit();
}

?>

Label: , , , ,

Bagikan ke :
facebook google+ twitter BBM

Tulisan How to redirect page if user used UCBrowser ini ditulis pada 7/01/2015, Admin akan berusaha sebaik mungkin agar informasi ini sesuai dengan kondisi saat ini (Terupdate), harap maklum jika informasi yang terkandung dalam artikel ini sudah kadaluarsa
| Cari How to redirect page if user used UCBrowser di : AOL | Ask | Bing | DuckDuckGo | Microsoft | Google | ixquick | Yahoo | Yandex | Yippy | MySearch