Set start page depending on screen width [closed]

It’s pretty hard for PHP to know your screen width. It’s more of a job for jQuery. But your approach seems kind of backward. If the site is supposed to be responsive — why are you trying to deliver different pages to your visitors based on screen width?

It would seem you should handle varying content via media queries.

So if you have 5 pieces of content… let’s say

  1. Header A – intended for desktop

  2. Header B – intended for mobile

  3. Content – same for all

  4. Footer A – intended for desktop

  5. Footer B – intended for mobile

You would hide the mobile (B) components when screen width is greater than X, and show the desktop (A) components.

Conversely, when screen width is less than X, you would do the opposite: showing mobile components (B) and hiding desktop components (A).

Make sense?