Search In
Learn from 350 other Umbracians at the annual Umbraco Conference - CodeGarden '13. More than twenty high quality sessions, open spaces, hackathons and social events you'll remember. Not to be missed! Less than 25 tickets left - get yours now!
Below is my current configuration
<redirect firstRequestOnly="true" timeout="20" devicesFile="~/App_Data/Devices.dat"> <locations> <location name="default" url="http://localhost:52653/?alttemplate=mobile"> <add property="url" matchExpression="http://localhost:52653"/> <add property="IsMobileDevice" matchExpression="true"/> </location> <location name="pages" url="~/{0}?alttemplate=mobile" matchExpression="(?<=^\w+://.+/).+" > <add property="IsMobileDevice" matchExpression="true"/> </location> </locations></redirect>
The issue I have is that if i request default.aspx directly (http://localhost:52653/default.aspx) alttemplate=mobile is appended however if I enter http://localhost:52653 the following redirect occurs http://localhost:52653/%7B0%7D?alttemplate=mobile.I have looked at other forum posts but can't seem to find an answer.
I think it's something to do with this part of the code:
<location name="pages" url="~/{0}?alttemplate=mobile" matchExpression="(?<=^\w+://.+/).+" > <add property="IsMobileDevice" matchExpression="true"/> </location>
As the redirect is sending you to: http://localhost:52653/{0}?alttemplate=mobile (it's just URL encoded it). Its either an issue with your regex, or it could be an issue with the 51 degrees detector, so it might be worth getting in touch with them as well on their codeplex site: http://51degrees.codeplex.com/ you could also try the support area of their site: 51degrees.mobi/.../Foundation.aspx
Hope that helps!
:)