Re: What's the simplest way to do URL rewriting?



Hi Alan:

<snip>
>
>Now, I have two issues left. The first is that I would really like to
>use the URL...
>
>http://whatever.com/order/123
>
>without the .aspx, but this gives a page not found error, presumably
>because the lack of .aspx extension means that IIS doesn't pass it to
>the ASP.NET engine. Is there any simple way around this?
>

That one is a pain, one way to get it to work is to create the 123
folder and put a default.aspx document inside. Then IIS will find the
a default document (assuming default.aspx is in the list of defaults
in IIS) and pass control to ASP.NET. Hopefully IIS7 will avoid this
problem but that is a long ways off.

>The bigger issue is that the /pdap/ folder (where the real .aspx page
>resides) is protected by Forms authentication. At the moment, if someone
>tries the URL http://whatever.com/order123.aspx and are not logged in,
>it sends them to the log in page. I would prefer they get sent elsewhere
>(say to the home page as the other failed requests do now).
>
>I tried adding ...
>
>if (User.Identity.IsAuthenticated) {
>

My guess is that because the user isn't authenticated until later in
the pipeline processing (AuthenticateRequest comes after BeginRequest)
that IsAuthenticated will always be false at that point. You might
want to push that login into the AuthorizeRequest event...

HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/
.



Relevant Pages

  • Re: Permission problem in ASP.NET and IIS
    ... which takes care of aspx files. ... web.config (authentication and authorization section) and what is your IIS ... they get a login prompt. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Securing .htm pages with asp.net
    ... you have to route the .htm extension to the aspnet_isapi dll, just like .aspx ... you do that in IIS application settings. ... > I've tried using forms authentication, ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: HELP PLEASE The request failed with HTTP status 401: Access Denied.
    ... Web Security: Part 2: Introducing the Web Application Manager, Client ... Authentication Options, and Process Isolation ... It introduces the Web Application Manager in IIS that ... logon session, which is dangerous. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • RE: Can no longer access ActiveSync
    ... OMA and Exchange/Exchange-OMA virtual directory. ... Please verify Authentication settings by the following steps. ... Open IIS Manager ... issue may be caused by the Exchange attribute of original user account. ...
    (microsoft.public.exchange.admin)
  • Re: Basic Authentication fails with Error 401.2 where Integrated s
    ... I didn't realise the Web Sites folder in IIS manager threw up a global ... sure that Basic Authentication is allowed to function on your server. ... ACCOUNTNAME, this is the account that I am trying to grant access to: ... Account: COMPUTERNAME\ACCOUNTNAME Access type: FULL ...
    (microsoft.public.inetserver.iis.security)