Welcome to HostingForumz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

Custom error page configuration by script in IIS 7

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Related Topics:
file name not logged w/ custom 404 error script - Hello, I have created a custom 404 error page which is an ASP script. The script can determine the requested page (by looking at and then process the request as intended. However when I look in the web log file, I see the name..

ADSI Script to configure Custom Error Documents - Hi, Thanks for your time in advance. I am trying to write ADSI script to modify the custom error documents in IIS. I am able to list the custom error document details, but I am unable to modify them. Whenver I modify the custom error document, I am..

Custom 500 error page...... - Im trying to setup a virtual web site that we can use as a for site that brings down another site and only shows one page I dont know of a global way of just all traffic to that one page (is there a..

IIS Error Page instead of Custom Error Page - I apologize - posted this in but don't know if it's a managed So am reposting here. Users on same domain with same version of IE (IE 6.0 SP2) are seeing different behavior with error pages in ASPX..

IIS doesn't redirect to error 500 custom page - Hi I'm trying to set up a custom 500 error handling in IIS6 So I follow help on these web pages and..
Next:  IIS: Users prompted to login trying to "save as..." Excel file ..  
Author Message
Jay Freedman

External


Since: Feb 18, 2008
Posts: 1



(Msg. 1) Posted: Mon Feb 18, 2008 1:21 pm
Post subject: Custom error page configuration by script in IIS 7
Archived from groups: microsoft>public>inetserver>iis (more info?)

I have an installer that uses a VBScript to create and configure a new
virtual directory, and it works perfectly in IIS 6. Now I'm adapting the
script for IIS 7, and most of it works without changes (by going through the
IIS 6 compatibility API). But I've run into one item I can't get to work,
and I'm looking for advice or hints on how to do it.

The installation includes a custom error page for the 403.9 error. The IIS 6
script creates the virtual directory (assigned to VDirObj), sets a bunch of
attributes for it, and then does this:

lstCE = VDirObj.GetEx("HttpErrors")
For idx = 0 To UBound(lstCE)
If Instr(lstCE(idx), "403,9") Then
lstCE(idx) = "403,9,FILE," & FullPath & "403-9_TooManyUsers.htm"
End If
Next
VDirObj.PutEx 2, "HttpErrors", lstCE
VDirObj.SetInfo

In IIS 7, the newly initialized virtual directory doesn't have an entry in
the list for 403.9, so the loop ends without finding it, and nothing
happens.

I tried using the value 3 (APPEND) instead of 2 (UPDATE) in the PutEx call
to just add the entry:

VDirObj.PutEx 3, "HttpErrors", "403,9,FILE," & FullPath &
"403-9_TooManyUsers.htm"

There were no errors, but it didn't work -- the IIS manager didn't show any
change in the list of error pages, nor did it appear in the
applicationHost.config file. (I can add the page through the GUI, but that
doesn't help in what's supposed to be a one-button installer.)

I suppose I could add the entry directly to the XML in
applicationHost.config, but I'm curious to know if there's a simpler way
that actually works.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

 >> Stay informed about: Custom error page configuration by script in IIS 7 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]