[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Script creating a virtual direcotry redirect in iis6?

Posted on 2014-02-10
2
Medium Priority
?
457 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Suggested Courses

650 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