?
Solved

Script creating a virtual direcotry redirect in iis6?

Posted on 2014-02-10
2
Medium Priority
?
450 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 29

Accepted Solution

by:
becraig earned 2000 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

Quick Cloud Training

Looking for some quick training on the cloud in 2 hours or less? Check out these how-to guides in AWS, Linux, OpenStack, Azure, and more!

Question has a verified solution.

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

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
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.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

770 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