x First time here? Check out the FAQ

Come work for Umbraco - The Umbraco HQ are hiring Project managers, .NET developers and DevOps people!

  • Avatar59posts86karma

    Trouble with 51 degrees mobi configuration

    Jonathan Saxon started this topic September 7, 2011 @ 10:53

    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.


  • Avatar1078posts2168karma
    Comment with ID: 89293
    Tim posted this reply September 14, 2011 @ 03:04

    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 login or Sign up To post replies