Welcome, Guest
Username Password: Remember me

Error on home page when redirecting to dudamobile site.
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Error on home page when redirecting to dudamobile site.

Error on home page when redirecting to dudamobile site. 11 years, 11 months ago #12915

  • isitfast
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 0
We have a dudamobile account set up. I am using mobilejoomla to redirect mobile users to that site using the subdomain redirect. But when we first get to the dudamobile site it loads the following error (when on a phone):

Fatal error : Cannot redeclare class TeraWurflConfig in/home/isitfast/public_html/plugins/mobile/terawurfl/terawurfl/TeraWurflConfig.php on line 24


The error disappears if we click the home button but does not disappear if we refresh the page. I know the error isn't technically within a mobilejoomla template but it seems that it is calling back to the site which produces the error. Wondering if you have any input on what is causing this?

Re: Error on home page when redirecting to dudamobile site. 11 years, 11 months ago #12928

  • dryabov
  • OFFLINE
  • Administrator
  • Denis Ryabov, Lead Developer
  • Posts: 4867
  • Karma: 105
Could you list all enabled plugins of "mobile" group?

Re: Error on home page when redirecting to dudamobile site. 11 years, 11 months ago #12952

  • RussDuda
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 0
isitfast wrote:
We have a dudamobile account set up. I am using mobilejoomla to redirect mobile users to that site using the subdomain redirect. But when we first get to the dudamobile site it loads the following error (when on a phone):

Fatal error : Cannot redeclare class TeraWurflConfig in/home/isitfast/public_html/plugins/mobile/terawurfl/terawurfl/TeraWurflConfig.php on line 24


The error disappears if we click the home button but does not disappear if we refresh the page. I know the error isn't technically within a mobilejoomla template but it seems that it is calling back to the site which produces the error. Wondering if you have any input on what is causing this?


Hi!

My suggestion would be to use the PHP redirect code that Duda offers, instead of trying another joomla plugin. Here is the exact PHP code you will want to use:

<?php
$mobileDomain = "m.example.com";
$no_redirect = @$_REQUEST['no_redirect'];
if($no_redirect != "true")
{
    $agent = @$_SERVER['HTTP_USER_AGENT'];
    @ini_set('default_socket_timeout',1);
    $handle = @fopen("mobile.dudamobile.com/api/public/detect?ua=" . urlencode($agent), "r");
    @stream_set_timeout($handle, 1);




    /* check if we should redirect*/
    $result = @fread ( $handle , 1 );




    @fclose($handle);
    if ($result == "y") {
        $currenturl = "".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
        $mobileUrl = $mobileDomain ."?url=" .urlencode($currenturl);
        $mobileUrl=$mobileUrl."&dm_redirected=true";
        header("Location: ".$mobileUrl);
        exit;
    }
}
?>

**Make sure you change the m.example.com URL to the URL of your mobile site.

Additionally, this should be installed in your template(index.php) file. You can find some directions of how to access the template and install the redirect code here:

www.dudamobile.com/redirect/joomla

Best,
Russ
DudaMobile Team

Re: Error on home page when redirecting to dudamobile site. 11 years, 11 months ago #12953

  • isitfast
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 0
Russ,

I got it working thanks to that video. You guys should really have a link to that (or a support area) from the home page. My partner set up the duda stuff but I had no way to know how to install the redirect. My main concern is the coding you provided on here is much longer than that which was provided by duda. Not to mention it didn't seem to work. I just inserted the two lines of script that came in the email into the index.php file (within my template) and it started working.

Thanks!

Re: Error on home page when redirecting to dudamobile site. 11 years, 11 months ago #12954

  • RussDuda
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 0
Sure. I should have said that the PHP code I provided above goes at the VERY top of the index.php file, even above the first <?php line. 

The script that you used is the javascript code, which works as well. 

Thanks,
Russ
  • Page:
  • 1
Time to create page: 0.08 seconds

By continuing to use this site you consent to the use of cookies on your device as described in our cookie policy unless you have disabled them. This site will not function correctly without cookies.

I accept cookies from this site.