problem removing HttpRedirect in a script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Scott Glover

    problem removing HttpRedirect in a script

    Hi,
    I'm running IIS on Win2K Advanced Server. My backend database on unix
    gets suspended each night for backup purposes. This causes problems
    for the middleware if users try to access the database during this
    time.
    So I thought I'd redirect all requests for pages in my app to a page
    saying the site is offline temporarily (ten minutes)
    I'm trying to do this using VBScript, exposing the IIS architecture
    using

    set iisobj = GetObject("IIS://localhost/W3svc/1/ROOT/apps")

    where "apps" is the name of the virtual directory where my app
    resides. I redirect using

    iisobj.Put "HttpRedire ct", "http://mymachine/offline.asp,
    EXACT_DESTINATI ON"

    and all this works fine.

    My problem arises when I try to revert the redirect, ie, get rid of
    it. I've tried setting the HttpRedirect property to an empty string
    but requests for eg, http://mymachine/apps/login.asp are redirected to
    http://mymachine/login.asp, which doesn't exist. I also tried setting
    HttpRedirect to "http://" but I get Cannot Find Server Page Cannot Be
    Displayed when I try to browse to http://mymachine/apps/login.asp. I
    tried stopping and starting the server but no joy. The only way I can
    get it back is by setting the HttpRedirect as above and then opening
    the IIS mmc snap-in and clicking the radio button for "A directory
    located on this computer" in the property pages for my virtual
    directory.

    does anybody know how I can do this using a script?

    Thanks
    Scott
Working...