rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: Dan on November 07, 2006, 07:21:40 PM

Title: Custom Error Pages
Post by: Dan on November 07, 2006, 07:21:40 PM
I have looked everywhere I could possibly think of, so I apologize if this has been answered somewhere, but I cannot figure out how to make custom error pages (404, 403, 401).  Could someone please explain this to me?  Thanks.
Title: Re: Custom Error Pages
Post by: rejetto on November 07, 2006, 07:26:43 PM
"edit html template"
Title: Re: Custom Error Pages
Post by: Dan on November 07, 2006, 07:29:23 PM
I tried that, but when I ban myself and go to my server, I get this message:

403 - You are not allowed to access this file
 ??? ???
Title: Re: Custom Error Pages
Post by: rejetto on November 07, 2006, 07:32:15 PM
i just tried to ban myself, then got this message
You are banned.
adgoaia
HttpFileServer 2.1a
07/11/2006 20.31.46
Title: Re: Custom Error Pages
Post by: Dan on November 07, 2006, 07:35:11 PM
This is the code I have:

Code: [Select]
[ban]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<title>Oh, fuck...</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
<style type="text/css" media="screen">\n%style%\n</style>
</head>
<body>
<div id="content">
<div id="divPageBody">
<div id="divTitle">Bann!</div>
<h1>Great! You're permanently BANNED!</h1>
<b>%reason%</b>
    <!-- FOOTER -->
<DIV id="divFooter">
<TABLE cellSpacing="0" cellPadding="0" width="500" align="center" border="0">
  <TBODY>
  <TR>
    <TD height="20" width="100%">&nbsp;</TD></TR>
  <TR>
    <TD><HR></TD></TR>
  <TR>
<TD class="copyright"><br>&copy; 2005 Roman V. Brooks.<BR>All Rights Reserved.</TD>
</TR><tr><td align="center">&nbsp;<br /><a href="http://www.rejetto.com/hfs" target="_blank" class="copyright" >Powered by HFS %version%</a></td></tr>
  <TR>
    <TD height="20" width="100%">&nbsp;</TD></TR>
</TR>
</TBODY></TABLE></div>
   <!-- END FOOTER -->

Do I need to change something?
Title: Re: Custom Error Pages
Post by: rejetto on November 07, 2006, 07:39:48 PM
this is not the original template.
try using the default template and see if the problem disappear.
Title: Re: Custom Error Pages
Post by: Dan on November 07, 2006, 07:49:39 PM
Is there a way for me to see where the 403 message is being pulled from?  I can't find that in the template at all.  :(
Title: Re: Custom Error Pages
Post by: rejetto on November 07, 2006, 07:54:51 PM
involved section of the template may be [ban] and [deny]
have a look at them.

that message you got is furnished by HFS if the section is missing in the template.
Title: Re: Custom Error Pages
Post by: Dan on November 07, 2006, 08:09:55 PM
I changed both the banned and denied section to read only "Banned", but I am still getting that same 403 message which doesn't seem to exist in the template.
Title: Re: Custom Error Pages
Post by: rejetto on November 07, 2006, 08:12:24 PM
before, you should test with the default template.
tell me if the default template works good for you.
Title: Re: Custom Error Pages
Post by: Dan on November 07, 2006, 08:15:37 PM
Yes, it works with the default template.  Must be an error somewhere in this template.
Title: Re: Custom Error Pages
Post by: rejetto on November 07, 2006, 08:18:03 PM
try adding this to your template

[error-page]
%content%
Title: Re: Custom Error Pages
Post by: Dan on November 07, 2006, 08:22:12 PM
You rock   :D
Title: Re: Custom Error Pages
Post by: rejetto on November 07, 2006, 08:23:10 PM
your template is for an old version of HFS, i guess pre-2.0

try searching for a newer version
Title: Re: Custom Error Pages
Post by: Dan on November 07, 2006, 08:27:08 PM
Will do.  Thanks a bunch!