forms authentication: redirects for *.aspx pages only, not for other extensions, not for static cont

Discussion in 'ASP .Net' started by www.MSmobiles.com, Jul 17, 2004.

  1. Hi!

    I am using something like this in web.config :

    <authentication mode="Forms">
    <forms name=".MSMOBILES_COM___COOKIE"
    loginUrl="login.aspx"
    protection="All"
    timeout="30"
    path="/">
    <credentials passwordFormat="Clear">
    <user name="user1" password="password1"/>
    </credentials>
    </forms>
    </authentication>
    </authentication>

    then, when I try to access some *.aspx page, for example:

    myserver.com/kirk.aspx

    I get redirection to:

    myserver.com/login.aspx?ReturnUrl=%2fportal%2fdupa.aspx

    and then everything is OK, but when try to access some other pages and
    content for example:

    myserver.com/test1.html
    or
    myservrc.com/test1.gif

    ..... then NO REDIRECTION takes place and the server allows access to this
    content!!!!
    How to force IIS to make rediredction also in case of static (i.e. not
    *.aspx) content????
     
    www.MSmobiles.com, Jul 17, 2004
    #1
    1. Advertising

  2. www.MSmobiles.com

    Teemu Keiski Guest

    Hi,

    that is because those files are not ptocessed by ASP.NET by default. You
    need to associate those file extensions with ASP.NET ISAPI filter to get
    them under ASP.NET processing.

    1. Open IIS, right-click the site and choose properties.
    2. Choose Home Directory tab
    3. Click 'Configuration'

    In the opening window you'll see file extension mapping for every respective
    file type IIS undertands. Take a careful look hot it is for aspx filew and
    do the same for file extensions you want control over.


    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist
    http://blogs.aspadvice.com/joteke



    "www.MSmobiles.com" <> wrote in message
    news:u%...
    > Hi!
    >
    > I am using something like this in web.config :
    >
    > <authentication mode="Forms">
    > <forms name=".MSMOBILES_COM___COOKIE"
    > loginUrl="login.aspx"
    > protection="All"
    > timeout="30"
    > path="/">
    > <credentials passwordFormat="Clear">
    > <user name="user1" password="password1"/>
    > </credentials>
    > </forms>
    > </authentication>
    > </authentication>
    >
    > then, when I try to access some *.aspx page, for example:
    >
    > myserver.com/kirk.aspx
    >
    > I get redirection to:
    >
    > myserver.com/login.aspx?ReturnUrl=%2fportal%2fdupa.aspx
    >
    > and then everything is OK, but when try to access some other pages and
    > content for example:
    >
    > myserver.com/test1.html
    > or
    > myservrc.com/test1.gif
    >
    > .... then NO REDIRECTION takes place and the server allows access to this
    > content!!!!
    > How to force IIS to make rediredction also in case of static (i.e. not
    > *.aspx) content????
    >
    >
    >
    >
    >
     
    Teemu Keiski, Jul 18, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric
    Replies:
    2
    Views:
    1,497
    Tommy
    Feb 13, 2004
  2. gelbeiche
    Replies:
    6
    Views:
    443
    CrayzeeWulf
    Apr 25, 2005
  3. =?Utf-8?B?RGF2aWQgUmVoYWdlbg==?=

    ICallbackEventHandler problem with Content Pages and Web User Cont

    =?Utf-8?B?RGF2aWQgUmVoYWdlbg==?=, Dec 19, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    483
  4. bob
    Replies:
    2
    Views:
    275
    Jack Klein
    Feb 12, 2006
  5. Eric
    Replies:
    2
    Views:
    561
Loading...

Share This Page