Welcome Guest, Not a member yet? Register   Sign In
custom 404 page
#2

How do you have your controller setup? Do you have your controller named "error" and then function called "error404"? As 200 is a success response....

I have mine setup as a main controller (main.php) with all the default pages (Including error pages)

So controller main.php

PHP Code:
defined('BASEPATH') OR exit('No direct script access allowed');

class 
Main extends CI_Controller {
 
   public function __construct() {
 
       parent::__construct();
    }

    public function 
error_404() {
        
$data['page_name'] = '404 Not Found';

        
$this->load->view('static/header'$data);
        
$this->load->view('static/404');
        
$this->load->view('static/footer');
 
   }

I have more stuff for if user is logged in etc. but this is the basics of it.
Reply


Messages In This Thread
custom 404 page - by Paul1972UK - 11-30-2016, 08:13 AM
RE: custom 404 page - by neodite - 11-30-2016, 01:38 PM
RE: custom 404 page - by Paul1972UK - 12-01-2016, 09:14 AM
RE: custom 404 page - by wolfgang1983 - 12-01-2016, 02:17 PM
RE: custom 404 page - by Paul1972UK - 12-02-2016, 05:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB