1

I have a website. It's not responsive now. Normally we can check any responsive website by reduced the browser size if the are made by css3 media query. But I want to make a responsive view for my website. when user will visit the site by their PC, they can see the PC version. if they reduce the browser size, they will not be able to see the Mobile view. They will be able to see the mobile view if they only visit by there Mobile.

for example:

http://www.whatsapp.com

http://www.facebook.com

Mohammad Wahid
  • 105
  • 3
  • 13

1 Answers1

0

With php-mobile-detect you can detect a users browser and redirect a mobile to m.whatsapp.com for example. Is this what you are looking for?

Example:

require_once '../Mobile_Detect.php';
$detect = new Mobile_Detect;
if($detect->isMobile() || ($detect->isTablet()){
    // Redirect to the mobile version instead of the desktop version
    header('Location: m.yoursite.com');
}
Mandy Schoep
  • 942
  • 11
  • 19
  • Well, the mobile version of WhatsApp.com has a different website instead of a responsible stylesheet. The only way to "hide" the mobile version for desktop users is to detect if a user is on a mobile device and redirect it to a special designed mobile website. So are you making a special mobile website, then you should need this code, if you are using one website, you have to use css media queries. – Mandy Schoep Jan 17 '14 at 14:43