Copied to clipboard

Flag this post as spam?

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


  • ridi 71 posts 103 karma points
    Jan 18, 2011 @ 01:05
    ridi
    0

    Can't redirect to default.aspx

    Hello,

    i have a site http://blabla.com the problem is when i open the site without the default.aspx is error, but when i type http://blabla.com/default.aspx  it's work like a charm (even after i login).

    the error is like below

    Unhandled Execution Error
    Object reference not set to an instance of an object.
      at System.Web.Security.Membership.GetCurrentUserName()
      at System.Web.Security.Membership.GetUser()
      at umbraco.requestHandler..ctor(XmlDocument umbracoContent, String url)
      at umbraco.UmbracoDefault.Page_PreInit(Object sender, EventArgs e)
      at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
      at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
      at System.EventHandler.Invoke(Object sender, EventArgs e)
      at System.Web.UI.Page.OnPreInit(EventArgs e)
      at System.Web.UI.Page.PerformPreInit()
      at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    4.1579244532463 0.077490

     

    I'm using the latest umbraco 4.5.2 and i am securing all the nodes like below

    i am afraid that the problem is because i lock up all the public access in the homepage? or this happen because i hosted it at IIS 7. since when i host in the Cassini.. it's working good

  • Sascha Wolter 615 posts 1101 karma points
    Jan 18, 2011 @ 04:25
    Sascha Wolter
    0

    Hi ridi,

    did you set any hostnames manually (right-click -> Manage hostnames)? I am guessing that you want 'Homepage' to appear when the user goes to http://blabla.com?

    I'd probably prefer the urlRewriting solution here (although there are a couple other ways to fix this). Add the following to your /config/urlRewriting.config file:

          <add name="Home"

               virtualUrl="^~/$"

               rewriteUrlParameter="ExcludeFromClientQueryString"

               destinationUrl="~/default.aspx"

               ignoreCase="true"

               redirect="Application"

               redirectMode="Permanent"

               />

     

    That should do the trick!

     

    Sascha

  • ridi 71 posts 103 karma points
    Jan 18, 2011 @ 05:35
    ridi
    0

    Yessss it works !!!, thanks so much Sascha...

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies