Detect Viewport and Redirect To Different Homepage
browser, client-side, html, javascript, viewport
Solution
You can’t detect viewport size on the server, you need to do it client side.
A client-side redirect might not be your best solution either since it is obstructive and bad for search engines. Instead you can use media queries to apply different stylesheets (or cascades) targeting different ranges of screen resolutions without any server-side interaction.
Problem
I want to redirect the homepage to a different view if the initial viewport is a certain dimension. I was thinking about doing this with javascript and doing a redirect within the head tag. Is this the best possible way or can I detect anything on the server side first?