I'm trying to setup a mobile re-direction script in classic ASP that detects the HTTP request and if its mobile, it will redirect the request to a mobile version of that page
so if this link opened from a mobile device:
http://www.example.com/about.asp it would re-direct to http://m.example.com/about.asp
most of the script i have tried they all to a re-direct to the mobile site home page, but I need to have it re-direct to a page level.
if this is doable in IIS7.5 i'm all for it too.
I got this to work with a help,
right now i have an issue, I have few folders which I need to block them from re-directing. i have piece of code, the folders are NOT being re-directed which is okay but when I access any other pages it goes to a homepage m.example.com....not sure what I'm doing wrong here
<rule name="Mobile Redirect" stopProcessing="true">
<match url="^(example1|example2|exaple3)/?" ignoreCase="true" negate="true" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false">
<add input="{HTTP_USER_AGENT}" pattern="^(?!.*ipad).*(midp|mobile|phone).*$" />
<add input="{HTTP_X-Device-User-Agent}" pattern="midp|mobile|phone" />
<add input="{HTTP_X-OperaMini-Phone-UA}" pattern="midp|mobile|phone" />
</conditions>
<action type="Redirect" url="http://m.example.com/{R:0}" />
</rule>