how to make a custom 404

About the template and stylesheet - and changing the menu
Post Reply
twc
Posts: 233
Joined: Fri Jun 18, 2010 12:25 am
Location: Netherlands

how to make a custom 404

Post by twc » Mon Sep 26, 2011 2:25 pm

how can i make a custom 404 page ?

i dont want to see this below tkx

[ external image ]
Last edited by twc on Mon Sep 26, 2011 2:40 pm, edited 1 time in total.

cmb
Posts: 13672
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: how to make a custom 404

Post by cmb » Mon Sep 26, 2011 2:27 pm

Hi twc,

perhaps it's enough to change $tx['error']['404']?

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

twc
Posts: 233
Joined: Fri Jun 18, 2010 12:25 am
Location: Netherlands

Re: how to make a custom 404

Post by twc » Mon Sep 26, 2011 2:42 pm

cmb wrote:Hi twc,

perhaps it's enough to change $tx['error']['404']?

Christoph
tkx butt i mean outside ;)

i want to make 1 custom page, so wenn its error its redirect to 404 page.

cmb
Posts: 13672
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: how to make a custom 404

Post by cmb » Mon Sep 26, 2011 3:19 pm

Hi twc,

I found, that this wish was already expressed several times in the forum and in the wiki. So a quick and dirty hack is to change function shead in cms.php:

Code: Select all

function shead($s) {
    global $iis, $cgi, $tx, $txc, $title, $o;
    if ($s == '401')header(($cgi || $iis)?'status: 401 Unauthorized':'HTTP/1.0 401 Unauthorized');
    if ($s == '404') header('Location: http://www.google.com'); //enter the URL you wish to be redirected here; may be another CMSimple page
    $title = $tx['error'][$s];
    $o = '<h1>'.$title.'</h1>'.$o;
}
 
Christoph
Christoph M. Becker – Plugins for CMSimple_XH

twc
Posts: 233
Joined: Fri Jun 18, 2010 12:25 am
Location: Netherlands

Re: how to make a custom 404

Post by twc » Mon Sep 26, 2011 3:55 pm

cmb wrote:Hi twc,

I found, that this wish was already expressed several times in the forum and in the wiki. So a quick and dirty hack is to change function shead in cms.php:

Code: Select all

function shead($s) {
    global $iis, $cgi, $tx, $txc, $title, $o;
    if ($s == '401')header(($cgi || $iis)?'status: 401 Unauthorized':'HTTP/1.0 401 Unauthorized');
    if ($s == '404') header('Location: http://www.google.com'); //enter the URL you wish to be redirected here; may be another CMSimple page
    $title = $tx['error'][$s];
    $o = '<h1>'.$title.'</h1>'.$o;
}
 
Christoph

tkx :)

works now..
http://fiberdordrecht.nl/try

Post Reply