Page 1
Page 1
Started By
Message

Why is it so hard to redirect mobile users to a different url?

Posted on 7/6/14 at 11:08 pm
Posted by BigPapi21
United States
Member since Dec 2013
641 posts
Posted on 7/6/14 at 11:08 pm
I am so frustrated. I am trying to make it so that if a user on a mobile or tablet site visits my website that they are redirected to a page that says that my website ...

WEBSITE is not yet optimized for Mobile Devices.
We'll soon be available for Apple iOS, Windows & Android platforms.

Why is this so difficult? Does any web gurus have any suggestions? I have tried like 10 different scripts and none of them seem t work properly.

Thanks in advance
Posted by junkfunky
Member since Jan 2011
33851 posts
Posted on 7/6/14 at 11:32 pm to
I'm not sure because I've only used the cookie cutter sites but who is your host? I'd assume they would handle redirection to your m.yoursite.com mobile page.
Posted by BobRoss
Member since Jun 2014
1693 posts
Posted on 7/6/14 at 11:53 pm to
You need to code in HTML 5 and CSS 3, but you lose some of that functionality in outdated browsers.

What scripts have you used?
Posted by Hopeful Doc
Member since Sep 2010
14939 posts
Posted on 7/7/14 at 12:03 am to
quote:

I am so frustrated


I can't offer help, so I'll offer a funny, because laughter is the best medicine:
Posted by JollyGreenGiant
The Help Board
Member since Jul 2004
24915 posts
Posted on 7/7/14 at 9:59 am to
What have you tried? Simply checking the device's screen width has always worked just fine for me.

quote:

var width = (window.innerWidth > 0) ? window.innerWidth : screen.width;

Source

CSS media queries work as well. You could show/hide certain elements based on the device width.

quote:

@media (max-width: <whatever size your site is optimized for>px) {
.show-this-on-mobile {
display: inline;
}
}
@media (min-width: <whatever size your site is optimized for + 1>px) {
.hide-this-on-mobile {
display: none;
}
}

Posted by colorchangintiger
Dan Carlin
Member since Nov 2005
30979 posts
Posted on 7/7/14 at 10:07 am to
use responsive web design. It will save you and your users much frustration.
Posted by TigerinATL
Member since Feb 2005
61435 posts
Posted on 7/7/14 at 10:25 am to
quote:

I am trying to make it so that if a user on a mobile or tablet site visits my website that they are redirected to a page that says that my website ...

WEBSITE is not yet optimized for Mobile Devices.


Unless you have a launch date for mobile within the next few weeks, this seems like a bad idea. Let those who are willing to zoom and scroll their way through your site do so. A "coming soon" page essentially turns everyone away.
Posted by MrSmith
Member since Sep 2009
8311 posts
Posted on 7/7/14 at 2:20 pm to
If you HAVE to redirect, can it be based on screen size or do you need it based on device/browser type?
Posted by Korkstand
Member since Nov 2003
28702 posts
Posted on 7/7/14 at 2:31 pm to
quote:

use responsive web design. It will save you and your users much frustration.

Yep, and there are tons of frameworks that make this pretty easy these days.
Posted by nolanola
Member since Nov 2010
7580 posts
Posted on 7/7/14 at 9:49 pm to
quote:

use responsive web design. It will save you and your users much frustration.



The ugly truth about responsive design
Posted by Korkstand
Member since Nov 2003
28702 posts
Posted on 7/7/14 at 10:24 pm to
quote:

The ugly truth about responsive design

The ugly truth is that there is no free lunch. Developers still have to optimize sites, but responsive is still the way to go.
first pageprev pagePage 1 of 1Next pagelast page
refresh

Back to top
logoFollow TigerDroppings for LSU Football News
Follow us on Twitter, Facebook and Instagram to get the latest updates on LSU Football and Recruiting.

FacebookTwitterInstagram