1
Chris03
Custom Error Modules
  • 2004/6/7 4:14

  • Chris03

  • Quite a regular

  • Posts: 372

  • Since: 2004/2/22


Is there or can someone make a custom error module for 404 and what not errors?

2
Stewdio
Re: Custom Error Modules
  • 2004/6/7 4:26

  • Stewdio

  • Community Support Member

  • Posts: 1560

  • Since: 2003/5/7 1


Create (or edit) your .htaccess file to point to 404 errors.

Then create a new .php file and place it in the root of your site with the following code (change the image file to one of your own)

You can see this in action on a site I am working on athttp://broadsword.ships.acalltoduty.com/nofile.php

(The site has no public content, it's still in major development, but this will show you how it fits your theme and never needs to be changed)


<?php
include('mainfile.php');
include('header.php');
$xoopsOption['show_rblock'] = 1;
?>
<html>
<div align="middle">
The page you have requested can not be found on this website.<br>
Please be sure you have used the correct address or select a link from the menu.
<p>
<img src="/images/alert.gif" width="160" height="120">
</p>
<p>
(Error 404 Page Not found)
</p>
</div>
</html>
<?php
include('footer.php');
?>

Save as 404.php

3
ajaxbr
Re: Custom Error Modules
  • 2004/6/7 4:31

  • ajaxbr

  • Quite a regular

  • Posts: 276

  • Since: 2003/10/25


Some good advice on ALA: The Perfect 404
Happy XOOPSing!

4
Chris03
Re: Custom Error Modules
  • 2004/6/7 4:32

  • Chris03

  • Quite a regular

  • Posts: 372

  • Since: 2004/2/22


LOL thanks for the help that was fast!!!! They are using the same theme as my site!http://www.kickassamd.com

so basically create a blank PHP document called 404.php place that code into it, and all is well?

5
Chris03
Re: Custom Error Modules
  • 2004/6/7 4:37

  • Chris03

  • Quite a regular

  • Posts: 372

  • Since: 2004/2/22


K im not too into PHP yet still learning

<?php
$xoopsOption['show_rblock'] = 1;
?>

what is going on here? Showing the right block? If so my site as content on right center and left...

6
Stewdio
Re: Custom Error Modules
  • 2004/6/7 4:46

  • Stewdio

  • Community Support Member

  • Posts: 1560

  • Since: 2003/5/7 1


Copy and paste the code exactly as you see it and save as 404.php in your site root. It will show no matter what block configuration you use.

All you need to do is edit the content between the <html></html> tags to suit your tastes.

Don't forget to add:

ErrorDocument 404 /404.php

to your .htaccess file or the custom error page will not work!

You can create pages and point to them in your .htaccess for all your custom errors (302, 500, etc...)

Login

Who's Online

259 user(s) are online (170 user(s) are browsing Support Forums)


Members: 0


Guests: 259


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits