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?
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.
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
.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.