IIS Virtual Directory on-the-fly

IIS Virtual Directory on-the-fly

Post by John Hayco » Wed, 28 Mar 2007 02:46:35


Hi All

I've managed to create a virtual directory on the fly but I want it to
redirect to a url.

If you are doing it manually you just go to the properties of the folder
click on the "redirection to a url" radio button and then type the url you
want it to point at in the textbox.

Is there a way to set this up in code. You can set other properties like:
oVirDir.Properties["AccessRead"][0] = true;

oVirDir.Properties["AccessExecute"][0] = true;

Does anyone know of a property to redirect to a url?

Thanks in advance

John
 
 
 

IIS Virtual Directory on-the-fly

Post by Alexey Smi » Wed, 28 Mar 2007 03:04:49


HttpRedirect
http://www.yqcomputer.com/

 
 
 

IIS Virtual Directory on-the-fly

Post by Thomas Ha » Wed, 28 Mar 2007 07:08:27


Sounds like what you WANT to do is to create an IHttpHandler...
Look it up :)
 
 
 

IIS Virtual Directory on-the-fly

Post by JPH » Wed, 28 Mar 2007 21:15:57


Are you suggesting URL rewriting?

I was hoping to avoid that.

Cheers

John
 
 
 

IIS Virtual Directory on-the-fly

Post by JPH » Fri, 30 Mar 2007 00:31:07


I sussed it out. I knew there must be a property to do this but
finding it was a mare

Once you create your virtual directory you redirect it like this:

oVirDir.Properties["httpredirect"][0] = "http://localhost/website/
project.aspx?projectID=217";

Cheers for your help fellas

John