Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Setting redirects that work on cell phones

Discussion in 'General Discussion' started by vincentg, May 14, 2019.

  1. vincentg

    vincentg Well-Known Member

    Joined:
    May 12, 2004
    Messages:
    154
    Likes Received:
    3
    Trophy Points:
    168
    Location:
    new york
    Seems that cell phones require more attention when it comes to redirects.

    A simple redirect like going from www to no www doesn't work on a cell.
    Are there any guide lines for this?

    Redirects set with Cpanel work ok on a PC but not on a cell phone.
     
  2. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,124
    Likes Received:
    474
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @vincentg

    There should be no difference in the behavior of redirects from a browser to a cell phone, what you may be encountering is caching?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. vincentg

    vincentg Well-Known Member

    Joined:
    May 12, 2004
    Messages:
    154
    Likes Received:
    3
    Trophy Points:
    168
    Location:
    new york
    There should be but there is
    When you have an domain alias it doesn't redirect proper
     
  4. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,124
    Likes Received:
    474
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Do you have a way to reproduce the behavior? Detailed replication steps/examples would be useful in this instance.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. vincentg

    vincentg Well-Known Member

    Joined:
    May 12, 2004
    Messages:
    154
    Likes Received:
    3
    Trophy Points:
    168
    Location:
    new york
    Yes - this one

    example.tv

    example.net

    But we have problems with it

    Tried several ways to do it in .htaccess

    We will get it to work on a pc but not on a Cell phone.

    At current I left it as
    Code:
    ErrorDocument 404 /404.php
    RewriteCond %{HTTPS} off
    RewriteCond %{HTTP:X-Forwarded-SSL} !on
    RewriteCond %{HTTP_HOST} ^example\.tv$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.example\.tv$
    RewriteRule ^(.*)$ "https\:\/\/example\.net\/$1" [R=301,L]
    RewriteCond %{HTTPS} off
    RewriteCond %{HTTP:X-Forwarded-SSL} !on
    RewriteCond %{HTTP_HOST} ^example\.net$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.example\.net$
    RewriteRule ^(.*)$ "https\:\/\/example\.net\/$1" [R=301,L]
    
    Had to add
    Code:
    RewriteCond %{HTTPS} off
    RewriteCond %{HTTP:X-Forwarded-SSL} !on
    when redirect from alias
    
    Cpanel does not put it and if not there you get same ssl error as on phone
     
    #5 vincentg, May 24, 2019
    Last edited by a moderator: May 24, 2019
  6. Infopro

    Infopro cPanel Sr. Product Evangelist Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,877
    Likes Received:
    482
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I've removed your actual links and domain names from your post. I did check the original link in 2 different browsers on my cell phone first though. Here's what I get:

    IMG_6818.PNG IMG_6817.PNG
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. vincentg

    vincentg Well-Known Member

    Joined:
    May 12, 2004
    Messages:
    154
    Likes Received:
    3
    Trophy Points:
    168
    Location:
    new york
    I don't get that on original link on my phone but get it from alais which also does not change displayed url
     
  8. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,124
    Likes Received:
    474
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Based on the rewrite rules you have in your .htaccess it looks like you're forcing SSL but you don't have an SSL certificate. My assumption is you've added an exception for your site in the browser but not on the mobile device which is why you're seeing different things.

    I've tried looking at it this morning and I get redirected on both the mobile and browser without an SSL warning.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice