rejetto forum
July 31, 2010, 06:14:10 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Can I use my own 404 page?  (Read 404 times)
0 Members and 1 Guest are viewing this topic.
pepsiru1es92
Occasional poster
*
Offline Offline

United States United States

Posts: 6


View Profile Email
« on: October 15, 2009, 06:00:22 PM »
Reply with quoteQuote

I am fully aware of how to edit HFS's purple 404 page to say different things, but is there a code to just use a page I made (404.html)?

Thanks
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1253


Assistant programmer Assistant translator


View Profile WWW
« Reply #1 on: October 16, 2009, 02:52:51 AM »
Reply with quoteQuote

This is only an example adapted to the request made by ppsiru1es92, there are the other possibilities but based on this principle because it is inescapable to pass by the section [error-page] as follow:

In the template, all the sections ' page of error ' are integrated  into a section parent [error-page] trough the var %content%. If you wish to personalize the page 404, it is necessary to personalize the section [not found] by changing the section [error-page], which is then shared between two joined sections each in the other pages of error.

new template:
Quote
[error-page]
%content%

[error-page-head]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <style type="text/css">
  {.$style.css.}
  {.$style.user.}
  </style>
  </head>
<body>

[error-page-end]
<hr>
<div style="font-family:tahoma, verdana, arial, helvetica, sans; font-size:8pt;">
<a href="http://www.rejetto.com/hfs/">HttpFileServer %version%</a>
<br>%timestamp%
</div>
</body>
</html>

[not found]
<!-- this code redirect the user to the URL defined in the next line , the redirection is immediate-->
<METAR HTTP-EQUIV="Refresh" CONTENT="0; URL=http://myserver/404.html">
<!-- META HTTP-EQUIV="Pragma" CONTENT="no-cache" -->


[overload]
{.$error-page-head.}
<h1>{.!Server busy.}</h1>
{.!retry later.}
{.$error-page-end.}

[max contemp downloads]
{.$error-page-head.}
<h1>Download limit</h1>
{.!max s dl msg.}
{.$error-page-end.}

[unauthorized]
{.$error-page-head.}
<h1>Unauthorized</h1>
Your username and password don't match, or you are not allowed to access this resource.
{.$error-page-end.}

[deny]
{.$error-page-head.}
<h1>Unallowed</h1>
{.or|%reason%|This resource is not accessible..}
{.$error-page-end.}

[ban]
{.$error-page-head.}
<h1>You are banned.</h1>
%reason%
{.$error-page-end.}

It is obvious that the used macros  are compatible only with the beta version of hfs (the last one is the build 247 on this post). Wink

« Last Edit: October 16, 2009, 03:13:06 AM by Mars » Logged
pepsiru1es92
Occasional poster
*
Offline Offline

United States United States

Posts: 6


View Profile Email
« Reply #2 on: October 16, 2009, 04:26:43 PM »
Reply with quoteQuote

Well, I'm using build 155, so just for the hell of it I copy/paste'd the HTML from my 404 page and it worked. Thanks for your help Mars!

Also, if you care to see, here's the end result.

http://trg.servegame.com/deadlink.txt
« Last Edit: October 16, 2009, 04:32:22 PM by ppsiru1es92 » Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!


Google visited last this page July 27, 2010, 10:52:27 AM