How to have different web pages for different platforms?

I was wondering how to set the default page for a website to be different for desktop and mobile. For example if a pc accesses my website, it goes to indexD.html, and if it's an iphone it goes to indexM.html. I can create and modify.htaccess files if that helps.

You can use this:

<script> document.location.href = "index" + (window.innerWidth < 800? "M": "D") + ".html"; </script>

Not a perfect solution though, since it relies on window size and Javascript being activated.

A better solution is to use a single index.html and responsive CSS using @media rules.

  • Is the Selection of Movies on Netflix Different Between Platforms? I have netflix on my PS4 and on my IPad and IPhone. I find that some shows on my tablet and phone are not available on my PS4. For example IIm watching a show on my tablet called Suits (great show by the way) but when I search for it on my PS4 it says "Titles Related to Suits," The same thing happens with another show called The Americans. Its driving me INSANE. Is it a licensing problem between Sony Netflix and the TV networks?
  • IPhone safari won't open some web pages? I have the iPhone 5 and all of a sudden I can't get certain websites to open that I frequently use. I had someone else try to access them on their phone and they opened fine. I get the message that safari stopped responding because it can't find the server. Can anyone help please?
  • IPhone 4S, web pages don't load My iPhone 4S has just randomly stopped loading its pages, and it says that safari couldn't load them! I haven't changed any settings and I have unlimited Internet! Also iv notice that the signal bars keep going low and they don't do that! Any help would be grateful
  • Iphone 4S is connected to Wi-Fi but won't load pages? It only started today, i woke up and i had a bunch of problems. My power button is completely jammed and now this. Worst thing is, i have no warranty because it was a present and the gifters didn't give me any proof of purchase or anything >.< It says its connected. I tried resetting the network settings like the apple support suggested but nothing changed. I can't load a single page on safari or google chrome, but i can if i'm just using my 3G. Any suggestions?