Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Custom Errors

 
   Web Hosting and Web Master Forums (Home) -> IIS RSS
Next:  Same IIS Problem...different day...please help  
Author Message
wittnoah

External


Since: Jun 07, 2004
Posts: 1



(Msg. 1) Posted: Mon Jun 07, 2004 11:06 am
Post subject: Custom Errors
Archived from groups: microsoft>public>inetserver>iis (more info?)

I have a server with IIS5 windows 2000 advanced server.. All of the custom errors are missing in the custom errors tab for the website. How do you add them back so that you can modify them??

 >> Stay informed about: Custom Errors 
Back to top
Login to vote
yonlinemanghn1

External


Since: Jan 23, 2004
Posts: 206



(Msg. 2) Posted: Thu Jun 10, 2004 2:12 am
Post subject: RE: Custom Errors [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hello,
Here's a not-very-elegant script that you can use to add back the default
custom errors:

**************start of script*************
Dim NewArr
Dim IISSrverObj
Dim siteID

siteID = 1
Set IISSrverObj = GetObject("IIS://localhost/W3SVC/" & siteID & "/Root")

NewArr = IISSrverObj.GetEx( "HttpErrors" )
ReDim NewArr(31)

NewArr(0) = "400,*,FILE,C:\WINNT\help\iisHelp\common\400.htm"
NewArr(1) = "401,1,FILE,C:\WINNT\help\iisHelp\common\401-1.htm"
NewArr(2) = "401,2,FILE,C:\WINNT\help\iisHelp\common\401-2.htm"
NewArr(3) = "401,3,FILE,C:\WINNT\help\iisHelp\common\401-3.htm"
NewArr(4) = "401,4,FILE,C:\WINNT\help\iisHelp\common\401-4.htm"
NewArr(5) = "401,5,FILE,C:\WINNT\help\iisHelp\common\401-5.htm"
NewArr(6) = "403,1,FILE,C:\WINNT\help\iisHelp\common\403-1.htm"
NewArr(7) = "403,2,FILE,C:\WINNT\help\iisHelp\common\403-2.htm"
NewArr(Cool = "403,3,FILE,C:\WINNT\help\iisHelp\common\403-3.htm"
NewArr(9) = "403,4,FILE,C:\WINNT\help\iisHelp\common\403-4.htm"
NewArr(10) = "403,5,FILE,C:\WINNT\help\iisHelp\common\403-5.htm"
NewArr(11) = "403,6,FILE,C:\WINNT\help\iisHelp\common\403-6.htm"
NewArr(12) = "403,7,FILE,C:\WINNT\help\iisHelp\common\403-7.htm"
NewArr(13) = "403,8,FILE,C:\WINNT\help\iisHelp\common\403-8.htm"
NewArr(14) = "403,9,FILE,C:\WINNT\help\iisHelp\common\403-9.htm"
NewArr(15) = "403,10,FILE,C:\WINNT\help\iisHelp\common\403-10.htm"
NewArr(16) = "403,11,FILE,C:\WINNT\help\iisHelp\common\403-11.htm"
NewArr(17) = "403,12,FILE,C:\WINNT\help\iisHelp\common\403-12.htm"
NewArr(1Cool = "403,13,FILE,C:\WINNT\help\iisHelp\common\403-13.htm"
NewArr(19) = "403,15,FILE,C:\WINNT\help\iisHelp\common\403-15.htm"
NewArr(20) = "403,16,FILE,C:\WINNT\help\iisHelp\common\403-16.htm"
NewArr(21) = "403,17,FILE,C:\WINNT\help\iisHelp\common\403-17.htm"
NewArr(22) = "404,*,FILE,C:\WINNT\help\iisHelp\common\404b.htm"
NewArr(23) = "405,*,FILE,C:\WINNT\help\iisHelp\common\405.htm"
NewArr(24) = "406,*,FILE,C:\WINDOWS\help\iisHelp\common\406.htm"
NewArr(25) = "407,*,FILE,C:\WINDOWS\help\iisHelp\common\407.htm"
NewArr(26) = "412,*,FILE,C:\WINDOWS\help\iisHelp\common\412.htm"
NewArr(27) = "414,*,FILE,C:\WINDOWS\help\iisHelp\common\414.htm"
NewArr(2Cool = "500,12,FILE,C:\WINDOWS\help\iisHelp\common\500-12.htm"
NewArr(29) = "500,13,FILE,C:\WINDOWS\help\iisHelp\common\500-13.htm"
NewArr(30) = "500,15,FILE,C:\WINDOWS\help\iisHelp\common\500-15.htm"


IISSrverObj.PutEx 2, "HttpErrors", NewArr
IISSrverObj.SetInfo

MsgBox "Entry was Successful"

Set IISSrverObj = Nothing

**************end of script**************

1) Backup the IIS Metabase before running this script so that if something
goes wrong you can restore from this backup.
2) Save the above code in a notepad file and save it as customerror.vbs
3) Edit the code above to change the "siteID = 1" to the appropriate site
id. To confirm your site id, right click on the site in the IIS MMC, go to
Properties-> under the Website tab, click on the Properties button in the
enable logging section-> under the General properties tab, you will see the
Log file name in the format w3svc<siteid>/exyymmdd.log.
If you want to do this for all the sites, then here is what the code will
look like
Dim NewArr
Dim IISSrverObj

Set IISSrverObj = GetObject("IIS://localhost/W3SVC/" & "/Root")

NewArr = IISSrverObj.GetEx( "HttpErrors" )
ReDim NewArr(31)
...
....

Save and close the log file.
4) From command window switch to the folder where you saved this script and
run "customerror.vbs"
5) Restart IIS by running the command "iisreset"
6) Open the IIS Manager and confirm if you see the custom errors.

Hope this helps!!!
Thanks,
Yogita Manghnani
Microsoft Developer Support
Internet Information Server

*********************************************************************
  >>Please do not send email directly to this alias. This is an online
account name for newsgroup participation only.<<

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.

© 2003 Microsoft Corporation. All rights reserved.
*********************************************************************<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Custom Errors 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
IIS 5.0 Custom Errors Tab - Hello, When I go to my website in IIS and click properties and then go the custom errors tab, there is only one listed.? 500;100 URL /iisHelp/common/500-100.asp.. Can anyone please explain to me how I add all of the custom erros back? Thank you

Custom Errors for 401.1 - When I define a Custom Error for HTTP Error 400, I have a choice of "Default", "File" or "URL". However, I'd like to set a URL for HTTP 401.1, but the dialog box only shows "Default" and "File"? Is it p...

IIS Custom Errors - I changed the http error page for 401.2 in Custom Errors in IIS to my own customized page. Two things I found: 1) when I changed it to an aspx page, Netscape doesn't recognize the file extension and brings up an "unknown file type" dialog box. ...

custom errors don't work right sometimes - In Windows 2000. Say we want to log 404 errors to a database. To do = that we need a 404b.asp. If we put the 404b.asp in the root folder and = the client accesses a page hello.htm which doesn't exist they will see = in the address bar: ..

Problem with Custom Errors - Hi, I need to have a custom page displayed when visitors to my site enter incorrect username/password. The problem is I need these custome pages to be parsed, with asp/php or something. I think that I need to enter the path to the cstom error file as a...
   Web Hosting and Web Master Forums (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 ]