This is more than likely an IIS issue, but these forums have some really talented developers, so I thought I'd ask here:
We have access to our webserver. We have DNS set up to direct all *.ourdomain.org to this webserver. From there, within IIS, we can establish web apps via virtual directory by whatever name we like. app1.ourdomain.org, app2.ourdomain.org, etc. We came
across a problem where if a user puts in something that doesn't exist, it will run one of our applications (from what I can tell, the most recently added). So if they put in http://doesnotexist.ourdomain.org or even http://www.doesnotexist.ourdomain.org
it will run an existing app, while still showing the wrong URL in the nav bar. We are concerned that this will confuse some of our users.
I tried playing with the default application, and 400 error pages, but nothing has really solved the problem. Can any IIS gurus shed some light on how to handle this? If I had my choice, I'd like all typos to go to a specific app, but I'd be happy just
giving them an error page.
"Dream as if you'll live forever, live as if you'll die today." --James Dean
You will catch the typo domains on your site that has a blank host header. i.e. (all unassigned) or a particular IP + port 80 + blank host header. So, that is the site that you will want to setup a 404 or a redirect. Or, you can create a site specifically
for that.
You can use a 404 page or a httpmodule to watch for typo domains and try to guess what it should be. Or, you can have 404 page say something like: Opps, you have found this page in error. You typed {URL} but must have meant something else. Please try
again.". In other words, you can dynamically add the url in your 404 page.
Ahh, blank host header. I see. Yeah, I was setting up all new apps with a blank host header because I didn't know what it was, nor think it was important. That looks to have done the trick, thanks!
"Dream as if you'll live forever, live as if you'll die today." --James Dean
AceCorban
Star
12320 Points
2270 Posts
IIS: Typo URLs running existing applications
Mar 10, 2008 03:46 PM|LINK
This is more than likely an IIS issue, but these forums have some really talented developers, so I thought I'd ask here:
We have access to our webserver. We have DNS set up to direct all *.ourdomain.org to this webserver. From there, within IIS, we can establish web apps via virtual directory by whatever name we like. app1.ourdomain.org, app2.ourdomain.org, etc. We came across a problem where if a user puts in something that doesn't exist, it will run one of our applications (from what I can tell, the most recently added). So if they put in http://doesnotexist.ourdomain.org or even http://www.doesnotexist.ourdomain.org it will run an existing app, while still showing the wrong URL in the nav bar. We are concerned that this will confuse some of our users.
I tried playing with the default application, and 400 error pages, but nothing has really solved the problem. Can any IIS gurus shed some light on how to handle this? If I had my choice, I'd like all typos to go to a specific app, but I'd be happy just giving them an error page.
OWScott
Participant
1939 Points
360 Posts
ASPInsiders
MVP
Re: IIS: Typo URLs running existing applications
Mar 10, 2008 04:33 PM|LINK
You will catch the typo domains on your site that has a blank host header. i.e. (all unassigned) or a particular IP + port 80 + blank host header. So, that is the site that you will want to setup a 404 or a redirect. Or, you can create a site specifically for that.
You can use a 404 page or a httpmodule to watch for typo domains and try to guess what it should be. Or, you can have 404 page say something like: Opps, you have found this page in error. You typed {URL} but must have meant something else. Please try again.". In other words, you can dynamically add the url in your 404 page.
Microsoft MVP - IIS
Vaasnet
www.vaasnet.com
AceCorban
Star
12320 Points
2270 Posts
Re: IIS: Typo URLs running existing applications
Mar 10, 2008 05:09 PM|LINK
Ahh, blank host header. I see. Yeah, I was setting up all new apps with a blank host header because I didn't know what it was, nor think it was important. That looks to have done the trick, thanks!
OWScott
Participant
1939 Points
360 Posts
ASPInsiders
MVP
Re: IIS: Typo URLs running existing applications
Mar 10, 2008 06:00 PM|LINK
Great, glad to hear that that works for you.
Microsoft MVP - IIS
Vaasnet
www.vaasnet.com