Welcome Guest, Not a member yet? Register   Sign In
error page not found
#1

good day,

am new to code igniter, been practising with tuorial on the manual to create a blog, 

but my view page keeps saying page not found, 

this is my index: 
<h2><?php echo $title; ?></h2>

<?php foreach ($news as $news_item): ?>

        <h3><?php echo $news_item['title']; ?></h3>
        <div class="main">
                <?php echo $news_item['text']; ?>
        </div>
        <p><a href="<?php echo site_url('news/'.$news_item['slug']); ?>">View article</a></p>

<?php endforeach; ?>


this is the view page for each post : view.php 
<?php
echo '<h2>'.$news_item['title'].'</h2>';
echo $news_item['text'];

this is my routes: 
$route['news/create'] = 'news/create';
$route['news/(:any)'] = 'news/view/$1';
$route['news'] = 'news';
$route['(:any)'] = 'pages/view/$1';
$route['default_controller'] = 'pages/view';

and i confirmed that i have the details in the database. 

thank you if you can help
Reply
#2

(08-31-2017, 02:39 AM)noblesomto Wrote: good day,

am new to code igniter, been practising with tuorial on the manual to create a blog, 

but my view page keeps saying page not found, 

this is my index: 
<h2><?php echo $title; ?></h2>

<?php foreach ($news as $news_item): ?>

        <h3><?php echo $news_item['title']; ?></h3>
        <div class="main">
                <?php echo $news_item['text']; ?>
        </div>
        <p><a href="<?php echo site_url('news/'.$news_item['slug']); ?>">View article</a></p>

<?php endforeach; ?>


this is the view page for each post : view.php 
<?php
echo '<h2>'.$news_item['title'].'</h2>';
echo $news_item['text'];

this is my routes: 
$route['news/create'] = 'news/create';
$route['news/(:any)'] = 'news/view/$1';
$route['news'] = 'news';
$route['(:any)'] = 'pages/view/$1';
$route['default_controller'] = 'pages/view';

and i confirmed that i have the details in the database. 

thank you if you can help

Hi noblesomto

Check your conreollers and models are save with first letter caps and same name as the class name. check view file is properly placed into the view folder. Check if you have removed index.php from url or not. if no then you have to include index.php in url.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB