• Resolved Meadowvale Inspections

    (@meadowvale-inspections)


    I set up my site as http originally, and redirected it for mobile devices to a gomobi site. Everything worked exactly as expected.

    Then I purchased a SSL certificate, and redirected the http site to https. That also also works exactly as expected.

    However mobile devices now show the secure desktop version, not the mobile version. What can I do so that the desktop version continues to display the secure site, and the mobile devices display the mobile version. The mobile version does not need to be a secure version, but it certainly is OK if it is.

    meadowvaleinspections.com and m.meadowvaleinspections.com

    Thanks for any help or advice you can offer.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Seems you need one conditional mobile redirection “else” another second https redirection.

    I set up my site as http originally, and redirected it for mobile devices to a gomobi site

    How did you determine the device is mobile for the first redirection to gomobi?

    Then I purchased a SSL certificate, and redirected the http site to https

    Do this redirection only for the non-mobile devices, which ever ones are not redirected to gomobi.

    Thread Starter Meadowvale Inspections

    (@meadowvale-inspections)

    From what I recall, I inserted a javascript re-direction code somewhere into my site. I don’t remember where, and I haven’t been able to find it since.

    GoMobi gives me the following re-direction code:

    <script type=”text/javascript” src=”http://detect.deviceatlas.com/redirect.js?d=http://https://meadowvaleinspections.com&m=http://m.meadowvaleinspections.com”></script&gt;

    Looking at that without knowing exactly what it means, it appears it could be the re-direction code I want instead of whatever I have now. But I haven’t been able to figure out where to put it.

    Does that look like it might work to you if I ever figure out where it should go?

    And thanks for your help here. It’s terrific to have this opportunity to get advice from people who know a lot more that I do about this stuff.

    Thread Starter Meadowvale Inspections

    (@meadowvale-inspections)

    Still looking around. GoMobi says the code should be in the index.html file so I looked at that and saw I had already put the re-direction code in there. No luck though. Here is what I have in there now.

    /public_html/index.html_

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;
    <html xmlns=”http://www.w3.org/1999/xhtml”&gt;
    <head>

    <script type=”text/javascript” src=”http://detect.deviceatlas.com/redirect.js?d=http://https://meadowvaleinspections.com&m=http://m.meadowvaleinspections.com”></script&gt;

    <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
    <title>Welcome to HostPapa</title>

    <style type=”text/css”> and a bunch of other stuff.

    /public_html/index.html_

    notice that is not the same as index.html. In wordpress there is no index.html, and scripts typically should be enqueued.

    <script type=”text/javascript” src=”http://detect.deviceatlas.com/redirect.js?d=http://https://meadowvaleinspections.com&m=http://m.meadowvaleinspections.com”></script&gt;

    And even if the code is in the correct location, it doesn’t seem right to me, I would consult host papa, gomobi, and/or deviceatlas.com

    Thread Starter Meadowvale Inspections

    (@meadowvale-inspections)

    I tried this code generated by GoMobi using DeviceAtlas. No luck yet. Any other advice? (HopeI’m using the backticks properly here!)

    <?php
    /**
    * @package mredirect
    * @version 1.1
    */
    /*
      Plugin Name: Mobile Redirection Plugin
      Description: Redirect mobile visitors to mobile site using DeviceAtlas device detection service.
      Version: 1.1
    */
      define('MOBILE_SITE', 'http://m.meadowvaleinspections.com');
      header('Vary: User-Agent');
    
      function load_redirection_script()
      {
        $path = strlen($_SERVER['REQUEST_URI'])>1 ? '/w/'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] : '';
    
        print '<script type="text/javascript" src="http://detect.deviceatlas.com/redirect.js?m='.MOBILE_SITE.'&smart=off"></script>';
        print '<link rel="alternate" media="only screen and (max-width: 640px)" href="'.MOBILE_SITE.$path.'" >';
      }
    
      add_action('wp_head', 'load_redirection_script');

    Hi, I see these posts are 8 months old, but now I’m having the same issue. Meadowvale Inspections, were you ever able to solve this issue?

    Thread Starter Meadowvale Inspections

    (@meadowvale-inspections)

    Hi. Yes I was able to get it fixed, but I didn’t do it. I had my hosting provider do it for me. That was probably reasonable since they sold me the gomobi site in the first place. From what I remember, the change was made through my htaccess file, but I really have no idea what the exact changes were.

    I no longer use the gomobi site for my mobile website. Not that there was anything wrong with it, but I decided to use a responsive website theme instead, and now the mobile version and the desktop versions are pretty much the same. It’s a MUCH better solution for me at least – only one site to update and it fits everything all the time. It’s definitely the way to go for me.

    Good luck. I hope this gives you some ideas at least.

    Thanks Meadowvale Inspections. I was able to resolve my issue. It had to do with CloudFlare and the use of it. So, I discontinued that service and my site returned to normal. For some reason the CloudFlare service did not deploy 100%. That’s what caused my issue.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘http redirects to https. how to also redirect for mobile device’ is closed to new replies.