Re: Throw System.UnauthorizedAccessException ?



"Norm" <neonorm@xxxxxxxxx> wrote in message
news:aba5076c-335f-45ca-8490-2a09d1d43785@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I would actually suggest against sending a 403 or some other HTTP
access denied because the crawlers may act adversly. The redirection
is a good idea. The crawlers will not care as long as it is a
temporary redirect, not a permanent one. Try something like this:

Response.StatusCode = 302
Response.Status = "302 Moved Temporarily"
Response.AddHeader("Location", "/Unauthorized.aspx") ' Note: "/
Unauthorized.aspx" is just an example
Response.End()

Surley HTTP Status 401 Unauthorized would be better, along with response.end
(no redirect, the browser will just say unauthorized )


.



Relevant Pages

  • Re: Throw System.UnauthorizedAccessException ?
    ... So throwing an UnauthorizedAccessException is not the same as sending ... I would actually suggest against sending a 403 or some other HTTP ... temporary redirect, not a permanent one. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Encrypted or Not Encrypted
    ... Indeed this is a manual redirect initiated by the user instead of a HTTP ... IMHO you need to make sure that you POST credentials via HTTPs. ... A possible test to make sure you establish a secure SSL connection before ... By analyzing the HTTP requests and responses you can also look at the HTTP ...
    (Security-Basics)
  • Re: Redirect https to http Exchange 2007
    ... I took off require SSL on the /OWA dir and i can get to ... it by http and https, but the redirect to https isnt working if i force ssl ... /OWA vdir but the redirect to SSL isnt working, ...
    (microsoft.public.exchange.admin)
  • Re: Danger to having Port 80 open on hardware firewall
    ... Seems to me that if you don't port forward 80, then you are not going to get ... the ssl redirection <http <> https>. ... >> requests never go any further. ... I usually redirect ...
    (microsoft.public.windows.server.sbs)
  • Re: Form Authentication (redirect to https)
    ... If I change the entry in the web.config to the following ... I get the windows login prompt. ... that if the user gets to the login page via http, ... the site that works with the redirect and one that doesn't. ...
    (microsoft.public.dotnet.framework.aspnet.security)