I have no idea how to even start doing this but how do I detect if a user is using a mobile device/browser and if so send them to a different URL?
There are many different ways to achieve this, including Server-Side and Client-Side solutions.
For the Server Side detection, you can parse the User-Agent String that is send to the Server. Depending on what programming language you are using, there may be libraries available that do this for you and return something like mobile True/False. You can then send a redirection header to send the user to the mobile site.
For Client Side detection see this question here: What is the best way to detect a handheld device in jQuery?