1

A customer created a virtual directory in IIS 6 as a sub-directory of another virtual directory and now is wondering why his URLs weren't working.

Is there some way to move the new virtual directory to the "root" of the website? Do I have to delete it and recreate it?

3 Answers 3

1

I do not believe there are any scripts to move a virtual directory.

I believe that any sort of script to do this will simply copy the properties to a variable, delete the original and create the new one from the stored variables.

It should not take you that long to create. You can create the new one before deleting the old one to make sure it works.

Just go to IIS, click the site, right click and then New > Virtual directory.

2
  • Unfortunately, I'm no IIS scripting whiz kid. Can you point me to an example script that does this? Jul 30, 2009 at 14:58
  • I can't point you to a script off by heart, but my method doesn't require any script it is all via gui. look at my last line - if you still need help, tell me and I will try to re-phrase it Jul 30, 2009 at 20:42
2

A virtual directory is a pointer to a physical directory. That means you can have multiple virtual directories in different web sites which point to the same physical folder.

If the customer created the folder as virtual directory (and not as physical folder in the physical folder of the "main" virtual directory) there is no problem. Just recreate the virtual directory pointing to the right physical folder.

If your customer created a physical folder in the wrong directory, I would copy the folder to the right place before recreating the virtual directory. Physical folders can change things in web.config files if they are nested.

0

There is no way to move the Virtual Directory. If it were me I'd create the new one in the right place then delete the one that is in the wrong place.

If the data is in the wrong place as well I'd move that very carefully. But changing the virtual directories should be pretty easy.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .