Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jonathan Saxon 59 posts 86 karma points
    Sep 07, 2011 @ 22:53
    Jonathan Saxon
    0

    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="(?&lt;=^\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.

  • Tim 1193 posts 2675 karma points MVP 3x c-trib
    Sep 14, 2011 @ 15:04
    Tim
    0

    I think it's something to do with this part of the code:

    <location name="pages" url="~/{0}?alttemplate=mobile" matchExpression="(?&lt;=^\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!

    :)

Please Sign in or register to post replies

Write your reply to:

Draft