Redirect Website to PC/Windows, Mac and Linux/Ubuntu Version

Here is a JavaScript code snippet for PC/Windows, Mac and Linux/Ubuntu User Agent Detection and then redirecting them to their version of website. Earlier I’d also posted how we can easily redirect website to their respective iPhone/iPod/iPad version, you might like to check that out as well. Replace PC Version with PC Version of your Website and Mac Version for Mac Version of your Website and Linux Version with Linux Version of your Website in the below code.

<script type="text/javascript">
    if ((navigator.userAgent.match(/MSIE/i)) || (navigator.userAgent.match(/Windows/i))) {
        location.replace("PC Version");
    } else if (navigator.userAgent.match(/Macintosh/i)) {
        location.replace("Mac Version");
    } else if (navigator.userAgent.match(/Linux/i)) {
        location.replace("Linux Version");
  • Amazing! Its truly awesome paragraph, I have got much clear idea on the topic of from this paragraph.

  • Aw, this was an incredibly good post. Taking a few minutes and actual

    effort to generate a great article… but what can I say… I procrastinate

    a whole lot and don't seem to get nearly anything done.

  • Excellent post. I absolutely love this website.