rooster
rooster

Reputation: 1

mobile redirect with joomla without htaccess

I have a joomla website,

  1. I am making a mobile site for it .
  2. I would like the mobile site to have a "full site" option.

When I do this, the redirect kicks in again. So the mobile user clicks full site, and the full sure is loaded, which has the mobile redirect script, then they get sent back to the mobile site.

Can you guys suggest what I should do?
Also,

So i need it to redirect to a sub folder, not a new joomla template. And I don't want to use mobile joomla. I also have no experience with htaccess Thanks

Upvotes: 0

Views: 244

Answers (2)

Someoneinthe
Someoneinthe

Reputation: 372

you can make it by a js file.

go on this site, and choose the right method: http://detectmobilebrowsers.com/

you have a lot of choices, you choose the only one you need / prefer.

Upvotes: 1

David
David

Reputation: 453

You can do it using PHP. Try something like this :

<?php

$iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
$palmpre = strpos($_SERVER['HTTP_USER_AGENT'],"webOS");
$berry = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
$ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");

if ($iphone || $android || $palmpre || $ipod || $berry == true) { 
    header('Location: http://mobile.site.com/');
}

?>

Upvotes: 0

Related Questions