Solved

Script creating a virtual direcotry redirect in iis6?

Posted on 2014-02-10
2
433 Views
Last Modified: 2014-03-12
Hello all

I have a large number of virtual directory redirects to put in place on an IIS 6.0 web server. I'd like to script this to save myself some time clicking a billion times in the interface.

I read an article about creating the virt directory with cscript but don't see how I can create a redirect using this syntax.

I imagine it's something simple I'm missing. Could anybody help?

I'm making redirects like www.mysite.com/AL that should be a virtual directory and redirect to www1.mysite.com/stuff/alaska.htm

Thanks!
0
Comment
Question by:scox72
2 Comments
 
LVL 29

Accepted Solution

by:
becraig earned 500 total points
ID: 39848087
Something like below should work.

cscript.exe adsutil.vbs set w3svc/2/Root/AL/HttpRedirect "www1.mysite.com/stuff/alaska.htm, EXACT_DESTINATION"
0
 

Author Comment

by:scox72
ID: 39923703
Sorry for abandoning this question -- I went on vacation and totally forgot about it.

Here's the essence of what I used, helped by becraig's suggestion above. This sets the virtual directory and the redirect.

iisvdir /creat w3svc/1/root/ diralias c:\inetpub\wwwroot\redirect
adsutil.vbs set w3svc/1/root/diralias/httpredirect "http://www.mysite.com/stuff/alias.htm, EXACT_DESTINATION"

not iisvdir and adsutil.vbs are in different directories on the server c:\windows\system32\ and c:\inetpub\adminscripts respectively.

Thanks agian becraig!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
The viewer will learn how to dynamically set the form action using jQuery.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question