Although I'm sure this question has been asked before, I can't seem to find any information on it. I am interested in creating two versions of my website - one specifically for mobile displayed on a subdomain like m., and another version for desktop.
I have checked Stack Overflow and found a similar question here, but the answers only discuss advantages and disadvantages, which is not what I need at this time.
While browsing the web, I stumbled upon a post by Mozilla suggesting user-agent-detection. However, I'm struggling to find a good example (maybe I'm using the wrong search terms).
If anyone could provide me with an example or a useful link demonstrating how to serve different websites based on browser viewport size, I would greatly appreciate it.