x First time here? Check out the FAQ

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!

  • Avatar57posts84karma

    Trouble with 51 degrees mobi configuration

    Jonathan Saxon started this topic September 7, 2011 @ 10:53 , this topic was edited at: Wednesday, September 14, 2011 3:04 PM

    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.


  • Replies

  • Avatar964posts1732karma
    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: 51degrees.mobi/.../Foundation.aspx

    Hope that helps!

    :)


Please login or Sign up To post replies