Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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: http://51degrees.mobi/Support/Documentation/Foundation.aspx
Hope that helps!
:)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Trouble with 51 degrees mobi configuration
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: http://51degrees.mobi/Support/Documentation/Foundation.aspx
Hope that helps!
:)
is working on a reply...