PDA

View Full Version : IIS problem.


Morgoth
03-01-2003, 04:10 AM
whammy, I am not sure if I should post this in here, but anyone that uses IIS probibly uses ASP, and I might get a reply from them here, if you think differently, you can move the post over into the computer issues forum.

In side of IIS, if I create a virtual directory, is there a way I might be able to make it so that, when I user types http://site.com/VirDir/FOLDER/
(and I have the propertise set, so that, when I type in http://site.com/VirDir/ it will not redirect me, but show the contents of another folder), it will only display the default page for the default folder?

So in other words, if I go to:
http://site.com/VirDir/
I will see the default page.
If I go to:
http://site.com/VirDir/Folder/
(not just "folder", but anything else) It will display the default image still.

So it's almost like I want to create a wildcard after /VirDir/ so it doesn't accually do anything, but directed it back to :
http://site.com/VirDir/


Anyone understand what I need? Could I do this using ASP, or Global.asa?

Morgoth
03-02-2003, 04:29 AM
Well, I checked it out.. I don't think it can be done with IIS itself..

But I believe perl can allow you to do it with a script or something...

whammy
03-02-2003, 05:52 AM
Have you tried removing the default page in IIS itself for that directory? Usually it's default.asp or index.htm... just guessing here since I don't get much of a chance to use it. But it can't hurt to try.

P.S. I'm not a "thread Nazi" or anything, this seems like a perfectly legitimate question. ;)

Morgoth
03-02-2003, 07:14 AM
Originally posted by whammy
Have you tried removing the default page in IIS itself for that directory? Usually it's default.asp or index.htm... just guessing here since I don't get much of a chance to use it. But it can't hurt to try.

P.S. I'm not a "thread Nazi" or anything, this seems like a perfectly legitimate question. ;)

I am not to sure what you mean by removing the default page... I need a default page for a single directory no matter what anyone types after /VirDir/
So far, all I know is Perl can possibly do it, but I don't think IIS can...


By the way, I don't think your a thread nazi, but since it could be more of a compter issue thing, it would make alot of sence being posted in that forum.

Accually, if you move the thread now to there, it might allow the people in that forum to help, and not just people in the ASP forum.

raf
03-02-2003, 10:15 PM
Morgoth,

In IIS you can have a global.asa for each application (and an application is everything in a virtual folder.)

If a new client starts a session (=request first page from virtual folder) the global.asa is processed. You can have a redirect there (in the session-onstart ) and work out some conditions to decide if the server needs to redirect (what the previous url was, what the IP is, which page was requested etc etc etc by using the ServerVariables("Path_Info") and stuff


<SCRIPT LANGUAGE=ScriptLanguage RUNAT=Server>
Sub Session_OnStart
. . .
End Sub

</SCRIPT>


if you need some more info on this, let me know

Morgoth
03-03-2003, 12:39 AM
Raf, thank you, I think this will work!

Morgoth
03-03-2003, 01:09 AM
Well, it works, but not all the time, and not for 404 errors...

This is why I only use Global.asa for keeping track on a counter for how many people are on my host at a time, cause it doesn't really matter if it's off by anything...

So Global.asa really isn't the best thing for this.