CodeIgniter Forums
New page can not be opened - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: General (https://forum.codeigniter.com/forumdisplay.php?fid=1)
+--- Forum: Regional User Groups (https://forum.codeigniter.com/forumdisplay.php?fid=25)
+--- Thread: New page can not be opened (/showthread.php?tid=71760)



New page can not be opened - Germanikus - 09-19-2018

Hello everybody,
I have started a new project and also the new version of the Codeigniter.
When I create a new folder in the view and create a page in it, then call this.
Do I get the message Object not found !, Error 404.

Now I'm just wondering why?
The test page welcome.php works without problems



Controller:
PHP Code:
    defined('BASEPATH') OR exit('No direct script access allowed');
    class 
Welcome extends CI_Controller {
        function 
__construct() {
            
parent::__construct();
        }
        public function 
index() {
            
$data['title'] = 'Startseite';
            
$this->load->view('welcome_message'$data);
        }

    public function 
test()
    {
        
$this->load->view('test');
    }
    public function 
welcome_message()
    {
        
$this->load->view('pages/welcome_message');
    }


routes.php
PHP Code:
// $route['default_controller'] = 'pages/index';
$route['default_controller'] = 'welcome';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
$route['news/create'] = 'news/create';
$route['news/(:any)'] = 'news/view/$1';
$route['news'] = 'news';
$route['(:any)'] = 'pages/view/$1';
// $route['default_controller'] = 'pages/view'; 



RE: New page can not be opened - salain - 09-20-2018

Hi,

What is the URL that gives your the 404 error?


RE: New page can not be opened - Germanikus - 09-20-2018

.../verwaltung/haushaltsbuch/index


RE: New page can not be opened - Wouter60 - 09-20-2018

It wouldn't surprise me if your route
PHP Code:
$route['(:any)'] = 'pages/view/$1'
translates this to:
…/pages/view/verwaltung/haushaltsbuch/index