mobile detect redirect

Community Forums Forums Design Tips and Tricks mobile detect redirect

This topic is: not resolved

This topic contains 6 replies, has 3 voices, and was last updated by  CynthiaC 2 years, 6 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #41623


    I am using the “News” responsive theme and would like to develop a simple ‘home page’ using the Landing Page feature that will ONLY be the home page when it detects a mobile browser.


    laptop will go to

    mobile device is automatically redirected to

    I have found different suggestions on the interweb but rather than muck up some perfectly good code I thought there might be a tried and tested Genesis Fix.

    Thank you

    • This topic was modified 2 years, 6 months ago by  CynthiaC.
    • This topic was modified 2 years, 6 months ago by  CynthiaC.


    The problem you may have is that you can define a screen size for the laptop in the media queries, however if other mobile devices are the same size – they too will be taken to that page. Do you want a particular sized device to show that new page?



    I would say it would  be most useful/practicable for the iphone/android or mini ipad.  Everything else would be just fine using the regular home page.




    Okay. Each theme developer codes media queries differently and some add all of them, while some only add a few. It is impossible to really anticipate all mobile devices but they do their best to code for the common ones. For example, some themes have issues with different browser version. The same with mobile devices – they come out with so many so quickly that there’s no way to keep up. So… the best thing to do is just try to come as close as reasonably possible.

    Brian Gardner wrote this Introduction to Media Queries. Read this and maybe you might see some type of mobile query that fits what you are looking for. Then copy paste it under your media queries and then add the styles in there.



    That doesn’t quite address the redirect issue.

    I would like the website to automatically redirect to a different home page when it detects a mobile device.

    Script would be something like this – but hoped for something to put in the function.php file instead?

    <script type=”text/javascript”>
    if($(window).width() < 600){
    window.location.href = “”


    Bill Murray

    @CynthiaC – I think you understand you can’t do this with media queries/responsive design.

    If you want to redirect mobile users to 1 page, the fastest way to do it would be via UA detection or MIME-type support (such as a check for WML) followed by redirection in your htaccess file (assuming your site is on an Apache server). These methods aren’t 100% foolproof, but they are pretty reliable. Your script solution would be another route (you could use Genesis settings to get that into the head of your document). There are also open source PHP libraries, like php-mobile-detect. I think the htaccess route would be the fastest.

    While you can do what you want, you might want to pause and ask yourself whether you should do what you want. From an SEO perspective, what you want to do isn’t a great SEO strategy. More info here.

    Hope that helps.

    Web: or Twitter: @wpperform

    We do managed WordPress hosting.



    Thanks to both of you,

    Lots of food for thought.

    I guess I will set up an ‘experimental’ site and see what I can come up with.


Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.