Re: What's the simplest way to do URL rewriting?
- From: Scott Allen <scott@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 24 Jun 2005 09:16:17 -0400
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/
.
- Follow-Ups:
- Re: What's the simplest way to do URL rewriting?
- From: Alan Silver
- Re: What's the simplest way to do URL rewriting?
- References:
- What's the simplest way to do URL rewriting?
- From: Alan Silver
- RE: What's the simplest way to do URL rewriting?
- From: Rakesh Rajan
- Re: What's the simplest way to do URL rewriting?
- From: Alan Silver
- Re: What's the simplest way to do URL rewriting?
- From: Scott Allen
- Re: What's the simplest way to do URL rewriting?
- From: Alan Silver
- Re: What's the simplest way to do URL rewriting?
- From: Alan Silver
- What's the simplest way to do URL rewriting?
- Prev by Date: Re: portal site Architecture
- Next by Date: Re: Laptops for programmers?
- Previous by thread: Re: What's the simplest way to do URL rewriting?
- Next by thread: Re: What's the simplest way to do URL rewriting?
- Index(es):
Relevant Pages
|