WordPress.org

Ready to get started?Download WordPress

Forums

how do you redirect to a mobile version of your site? (4 posts)

  1. rhender
    Member
    Posted 2 years ago #

    How do you redirect to a mobile version of your site?

    What is the best way to do it?

    Do you do it by adding code to the .htaccess file?

    Javascript? What is the best way.

    I have a mobile version of my site... http://www.site.mobi, that I would like mobile phone browsers to be redirected to...

  2. hotplugin
    Member
    Posted 2 years ago #

    <script type="text/javascript">
    <!--
    if (screen.width <= 699) {
    document.location = "mobile.html";
    }
    //-->
    </script>

    this should be enough.

  3. rhender
    Member
    Posted 2 years ago #

    wow! cool. I hope it works for me. thank you,

    I will let you know. :)

  4. rhender
    Member
    Posted 2 years ago #

    Well, I tried to put that in the <head> of the document, and it keeps giving me an
    Internal Server Error.

    I pasted it in exactly as you posted here.

    ??

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.