|
|
|
start date: Thu, 16 Aug 2007 19:41:00 -0000,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
unknown
|
|
2
Peter Bromberg [C# MVP]
|
|
3
unknown
|
Redirection Handling
Here is my setup:
I have a hosts file setup on the users machine that takes, for
example, www.youtube.com and redirects it to 127.0.0.1. On the local
machine is an IIS server that I would like to handle this youtube
request. So far so good, I can get the request for www.youtube.com
and print out something like "You tried to access www.youtube.com"
from Default.aspx. However, what about the case when a user tries to
access http://www.youtube.com/video1.aspx or http://www.youtube.com/watch?v=xxxxxxxxxxxx
In these cases the IIS server returns "Resource not found" or
something similar, depending on the document being requested.
My question is, how do I set up asp.net and the IIS server to handle
all requests, so I can have it then say "You tried accessing
http://www.youtube.com/watch?v=xxxxxxxxxxxx."
If this isn't clear in some way please let me know and I'll elaborate.
Thanks!
-Daniel
Date:Thu, 16 Aug 2007 19:41:00 -0000
Author:
|
RE: Redirection Handling
If you map your IIS 404 error to a general "404.aspx" handler, you can get
the full requested URL from the querystring (IIS appends it when redirecting
to the desgnated 404 error page).
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
"danielhamd@yahoo.com" wrote:
> Here is my setup:
>
> I have a hosts file setup on the users machine that takes, for
> example, www.youtube.com and redirects it to 127.0.0.1. On the local
> machine is an IIS server that I would like to handle this youtube
> request. So far so good, I can get the request for www.youtube.com
> and print out something like "You tried to access www.youtube.com"
> from Default.aspx. However, what about the case when a user tries to
> access http://www.youtube.com/video1.aspx or http://www.youtube.com/watch?v=xxxxxxxxxxxx
> In these cases the IIS server returns "Resource not found" or
> something similar, depending on the document being requested.
>
> My question is, how do I set up asp.net and the IIS server to handle
> all requests, so I can have it then say "You tried accessing
> http://www.youtube.com/watch?v=xxxxxxxxxxxx."
>
> If this isn't clear in some way please let me know and I'll elaborate.
>
> Thanks!
>
> -Daniel
>
>
Date:Thu, 16 Aug 2007 17:55:43 -0700
Author:
|
Re: Redirection Handling
I've tried this, however it doesn't seem to work when someone requests
an .aspx page. That gives a seperate sort of "server error." Is
there a way to set up a handler for that as well?
-Daniel
On Aug 16, 8:55 pm, Peter Bromberg [C# MVP]
wrote:
> If you map your IIS 404 error to a general "404.aspx" handler, you can get
> the full requested URL from the querystring (IIS appends it when redirecting
> to the desgnated 404 error page).
> -- Peter
> Recursion: see Recursion
> site: http://www.eggheadcafe.com
> unBlog: http://petesbloggerama.blogspot.com
> BlogMetaFinder: http://www.blogmetafinder.com
>
> "danielh...@yahoo.com" wrote:
> > Here is my setup:
>
> > I have a hosts file setup on the users machine that takes, for
> > example,www.youtube.comand redirects it to 127.0.0.1. On the local
> > machine is an IIS server that I would like to handle this youtube
> > request. So far so good, I can get the request forwww.youtube.com
> > and print out something like "You tried to accesswww.youtube.com"
> > from Default.aspx. However, what about the case when a user tries to
> > accesshttp://www.youtube.com/video1.aspxorhttp://www.youtube.com/watch?v=xxxxxxxxxxxx
> > In these cases the IIS server returns "Resource not found" or
> > something similar, depending on the document being requested.
>
> > My question is, how do I set up asp.net and the IIS server to handle
> > all requests, so I can have it then say "You tried accessing
> >http://www.youtube.com/watch?v=xxxxxxxxxxxx."
>
> > If this isn't clear in some way please let me know and I'll elaborate.
>
> > Thanks!
>
> > -Daniel
Date:Sat, 18 Aug 2007 14:29:35 -0000
Author:
|
|
|