Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PROBLEM Page Not Found Error
#4
(2014-09-27, 12:52:09)shawn_a Wrote: I can tell you one thing , this is not coming from gs.

Shawn, do you have an opinion on the following index.php file - is there 'extra' code that may be causing the problem? (I'm new to using getsimple)

Index.php:
<?php

/****************************************************

*
* @File: index.php
* @Package: GetSimple
* @Action: Where it all starts.
*

*****************************************************/

// Setup inclusions

$load['plugin'] = true;

// Relative

$relative = '';
$admin_relative = 'admin/inc/';
$lang_relative = 'admin/';
$base = true;

// Include common.php

include('admin/inc/common.php');

// get page id (url slug) that is being passed via .htaccess mod_rewrite

if (isset($_GET['id'])){

$id = str_replace ('..','',$_GET['id']);

$id = str_replace ('/','',$id);

$id = strtolower($id);

} else {

$id = "index";
}

// define page, spit out 404 if it doesn't exist

// it was a long night and I accidently set the 404 error as 403. Forgive me

$file = "data/pages/". $id .".xml";

$file_404 = "data/other/403.xml";

if (! file_exists($file))

{
if (file_exists($file_404))

{

$file = $file_404;
include($admin_relative. '404-mailer.php');
}

}

// get data from page

$data_index = getXML($file);

$title = $data_index->title;
$date = $data_index->pubDate;
$metak = $data_index->meta;
$metad = $data_index->metad;
$url = $data_index->url;
$content = $data_index->content;
$parent = $data_index->parent;
$template_file = $data_index->template;
$private = $data_index->private;

if ($private == 'Y') {

header('Location: 403');
exit;
}

if ($url == '403') {

header('HTTP/1.0 404 Not Found');
}

// include the functions.php page if it exists within the theme

if ( file_exists("theme/".$TEMPLATE."/functions.php") )

{
include("theme/".$TEMPLATE."/functions.php");
}

// call pretemplate Hook

exec_action('index-pretemplate');

// include the template and template file set within theme.php and each page

if ( (!file_exists("theme/".$TEMPLATE."/".$template_file)) || ($template_file == '') ) { $template_file = "template.php"; }

include("theme/".$TEMPLATE."/".$template_file);

// call posttemplate Hook

exec_action('index-posttemplate');

?>
Reply


Messages In This Thread
Page Not Found Error - by ckwimberly - 2014-09-27, 07:31:22
RE: Page Not Found Error - by shawn_a - 2014-09-27, 12:52:09
RE: Page Not Found Error - by ckwimberly - 2014-09-28, 00:29:31
RE: Page Not Found Error - by ckwimberly - 2014-09-28, 01:28:12
RE: Page Not Found Error - by shawn_a - 2014-09-28, 01:56:15
RE: Page Not Found Error - by ckwimberly - 2014-09-29, 01:52:51
RE: Page Not Found Error - by ckwimberly - 2014-10-02, 17:29:26
RE: Page Not Found Error - by ckwimberly - 2014-10-02, 18:27:06
RE: Page Not Found Error - by shawn_a - 2014-10-02, 23:07:46
RE: Page Not Found Error - by ckwimberly - 2014-10-04, 02:20:56
RE: Page Not Found Error - by shawn_a - 2014-10-04, 02:36:40
RE: Page Not Found Error - by Carlos - 2014-10-04, 03:35:33



Users browsing this thread: 3 Guest(s)