The WorksForWeb Community Forums
Welcome to the WorksForWeb community forums. Here you can discuss WorksForWeb products with others and contribute to the rapidly growing WorksForWeb community. Please note that while WorksForWeb staff try to maintain presence on the forums, this is not the most reliable way to contact WorksForWeb staff. In case you require a timely response from WorksForWeb on an issue, please open a support ticket here. For pre-sales questions, please open a sales ticket here.

Welcome, Guest. Please login or register.
February 09, 2012, 06:35:40 AM

Login with username, password and session length
Search:     Advanced search
Added the iLister-related Boards

Rate My Site Boards Added

Merged iAuto and iRealty Support Forums together

Several new tips in the Tips and Tricks section
1,602 Posts in 623 Topics by 1,179 Members
Latest Member: bobsteam
* Home Help Search Login Register
+  The iAuto/iRealty/iLister Support Forum
|-+  iAuto, iRealty and iLister v.4.x
| |-+  General iAuto Discussions
| | |-+  Problem with Custom 404 Page
« previous next »
Pages: [1] Print
Author Topic: Problem with Custom 404 Page  (Read 910 times)
Kevin
Newbie
*

Karma: 0
Posts: 4


View Profile
« on: January 26, 2010, 03:22:53 AM »

I seem to be having trouble with my custom 404 error page showing up. here is the code in my .htaccess file:

_______________________________________________________________________

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^eccarconnections.com [nc]
RewriteRule ^(.*)$ http://www.eccarconnections.com%{REQUEST_URI} [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* ./index.php

ErrorDocument 404 /page_not_found.html
______________________________________________________________________

I have tried everything I can think of. Am I missing something?

Here's the actual 404 page:
http://www.eccarconnections.com/page_not_found.html
« Last Edit: January 26, 2010, 03:27:17 AM by Kevin » Logged
nikolosnet
Newbie
*

Karma: 2
Posts: 8


View Profile
« Reply #1 on: January 26, 2010, 09:32:43 PM »

Your option will not work. In htaccess file all requests are sent to index.php, If this file exists then the design of "ErrorDocument 404 / page_not_found.html" not processed, because apache found he needed file. To address the need to index.php to handle the output buffer. For example:
Code:
//index.php
require_once('system/core/System.php');
System::loadSystemSettings ('system/user-config/DefaultSettings.php');
System::loadSystemSettings ('system/user-config/LocalSettings.php');

if (is_null(System::getSystemSettings('SITE_URL')))
{
header("Location: install.php");
exit;
}
elseif (is_readable("install.php"))
{
echo '<p>Your installation is temporarily disabled because the install.php file in the root of your'
.' installation is still readable.<br> To proceed, please remove the file or change its mode to make'
.' it non-readable for the Apache server process and refresh this page.</p>';
exit;
}

require_once('admin/lang/'. System::getSystemSettings('LOCALE').'.php');

System::boot();
System::init();
function buffer_handle($buffer){
if($buffer=="404 Not Found")
redirect(System::getSystemSettings('SITE_URL')."/page_not_found.html");
else
return $buffer;
}
ob_start('buffer_handle');
System::respond();
ob_flush();


Logged
Kevin
Newbie
*

Karma: 0
Posts: 4


View Profile
« Reply #2 on: January 26, 2010, 11:46:57 PM »

nikolosnet...Thanks !! that worked perfectly
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Classified Software by Worksforweb Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!