Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Our website has a large number of virtual directories being used as redirects (aprox. 150+). We're in the process of making a dev site that will ultimately become our live site so those directories need to be copied over to the new site. I have seen scripts to create virtual directories, but I don't see a way to set them as redirects. Is there a way to move these directories and what they redirect to with a script, or within IIS itself?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

The IIS 6 metabase is stored in an XML format, so you may be able to get away with slicing and dicing the XML files on the source and destination servers to get what you want.

Failing that, you could write a script using adsutil.vbs to enumerate all the directories on the source server and create them on the destination server. Setting a directory to do HTTP redirection involves setting the "HttpRedirect" metabase property with the destination URL and the appropriate flag (see http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/b652c863-6334-40be-8a97-db4b368f3ecc.mspx?mfr=true).

share|improve this answer
    
Thanks Evan. I know about the metabase, but I haven't heard much about playing with it other than a few horror stories. I'll take a look at that and the link. –  CoreyT Apr 4 '11 at 19:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.