I'm looking for an IIS solution (not programming) to redirect a website to a mobile version of the website. It looks like it might be possible, but not sure, with IIS Redirect or using IIS URL Rewrite 2.0. If this is the case how would one go about this?
Example: mywebsite.com/ redirects to (if mobile device) mywebsite.com/mobile
Side Note: We are currently using IIS Redirect to redirect http to https.
You should be able to use a condition in your IIS rewrite rule.
I don't have a 2008R2 machine to test, and make sure my syntax is correct but it should be enough to get you in the right direction.
The basics of this rule says:
This rule requires the use of a custom provider so you can store all the various user agents that might be mobile (and there is a long list of them). To setup the custom provider, take a look here.
I added the cookie check as some people still like to look at the full size site, even on their mobile device. This gives you a way to handle that by setting a cookie on their browser, and the rule skips them.
There is a slightly simpler version here that matches on a couple of examples too.