First off I don't know where on the forum, I should be posting this. I think that the .htaccess file would be my best chance to do this. So please be kind.

i want to post a link for users to click

www.blahblah.com/product.php?ID=18502

i would like it to detect mobile and instead take them to

www.blahblah.com/m/product.php?ID=18502

is this possible to modify the url like this?