View Full Version : Custom 404s
Mhtml
11-01-2002, 02:14 AM
Is it possible to serve up a page when a 404 error occurs without having it set in the iis conrtol panel?
JustAsking
11-01-2002, 03:30 AM
I was going to suggest using a .htaccess file, but since you are talking about iis I guess that is out of the question. Sorry bud no other ideas :cool:
Mhtml
11-01-2002, 03:51 AM
I believe that there is a form of .htaccess for iis, and I have seen somewhere you can use .htaccess on iis but can't find any info on it.
whammy
11-02-2002, 12:13 AM
You can just make your own custom page for 404 error and set it in IIS - but without the IIS control panel, I guess you're out of luck... unless you can modify your default .404 page.
jeorg
11-02-2002, 09:57 PM
with asp net is very simple on distant server
you just put into your web.config
<customErrors mode="RemoteOnly" defaultRedirect="messages.aspx?num=100">
<error statusCode="403" redirect="messages.aspx?num=403"/>
<error statusCode="404" redirect="messages.aspx?num=404"/>
<error statusCode="505" redirect="messages.aspx?num=505"/>
</customErrors>
Morgoth
11-03-2002, 06:58 PM
We have ASP.net installed and you can use any ASP.net scripts.
I went into my control panel and looked into the custom error pages, and I found one called 404 - and the link was to C:\WINNT\help\iisHelp\common\404b.htm
I changed this and if I force a 404, it wouldn't be the custom 404 page, apearently this isn't the correct 404 page, it doesn't allow me to change the other 404 page without effecting the the pages. Any clues on why or what this other 404 is?
Morgoth
11-03-2002, 07:05 PM
Hum.. acually. It seems that if I type in a link such as
http://site.com/asfkajsdfs.asp It will not work correctly with the custom error
Thought if I link to http://site.com/asfljsdhfksdjf.asp It will work fine and great.
So, Mhtml, If you want, I can follow your instructions to have it set on your site and if you tell me where your 404 page is to be, I will change it in the panel.
Mhtml
11-04-2002, 09:19 AM
On my site my 404 page will be in errors/404.asp
I'm going to try asp.net now since it is installed you certainly are a great web host morgoth.:thumbsup:
Mhtml
11-04-2002, 09:29 AM
jeorg I created a file named web.config and I have set up the pages it should refer to, but nothing happens on a 404 I just get the iis page.
I typed in web.config instead of a non existant file and then got a message:
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
Morgoth
11-04-2002, 01:18 PM
Originally posted by Mhtml
On my site my 404 page will be in errors/404.asp
I'm going to try asp.net now since it is installed you certainly are a great web host morgoth.:thumbsup:
I'm trying to make the greatest web server int he world, and when I am done with that, I will become the worlds best Pokemon trainer.
"Gotta catche them all, Pokemon!"
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.