CodeIgniter Forums
Getting Problem in Linking - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Getting Problem in Linking (/showthread.php?tid=515)



Getting Problem in Linking - Mayank - 12-12-2014

Hello,

I am new bee to CI. I just started to develop a dynamic page and I followed the Tutorial. I created the same pages with the same code as guided in this link "http://www.codeigniter.com/user_guide/tutorial/news_section.html". When I visit "application/views/news/index.php" it shows the data but the moment I click on "<p><a href="news/<?php echo $news_item['slug'] ?>">View article</a></p>" to get the full detail of the topic, it redirect the page but shows "404 Page Not Found" error.

Thanks


RE: Getting Problem in Linking - Rufnex - 12-12-2014

You have to put a .htaccess file into your document root like

PHP Code:
RewriteEngine on
RewriteBase 
/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond 
%{REQUEST_FILENAME} !-d
RewriteRule 
^(.*)$ index.php?/$[L



RE: Getting Problem in Linking - Mayank - 12-15-2014

Tried this code, but nothing has happened.

(12-12-2014, 06:05 AM)Rufnex Wrote: You have to put a .htaccess file into your document root like



PHP Code:
RewriteEngine on
RewriteBase 
/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond 
%{REQUEST_FILENAME} !-d
RewriteRule 
^(.*)$ index.php?/$[L



RE: Getting Problem in Linking - Rufnex - 12-15-2014

Can you explain how your controllers are organized .. is ther a News.php in /controllers


RE: Getting Problem in Linking - Mayank - 12-15-2014

Yes there is News.php in controllers. I followed "http://www.codeigniter.com/user_guide/tutorial/news_section.html". I did the same mentioned in link.


RE: Getting Problem in Linking - Rufnex - 12-15-2014

Please post you complete Link you try to connect.
Activate in /application/config/config.php the error logging

PHP Code:
$config['log_threshold'] = 4

and post the errors.


RE: Getting Problem in Linking - Mayank - 12-15-2014

I am working on localhost, here is the link "http://localhost/CodeIgniter/index.php/news" on this page I retrieve all the records stored in the news table with the hyperlink on "View article" just below to every record. When I click on "View article" of specific record to see the full details of it. It redirects to "http://localhost/CodeIgniter/index.php/news/lorem-ipsum". Here I get "404 Page Not Found".


RE: Getting Problem in Linking - Rufnex - 12-15-2014

Should the second link called by http://localhost/CodeIgniter/index.php/news/view/lorem-ipsum ?


RE: Getting Problem in Linking - Mayank - 12-15-2014

I already tried this way, but didn't get the success.


RE: Getting Problem in Linking - Rufnex - 12-15-2014

Where is your document root in apache is it

http://localhost

or

http://localhost/CodeIgniter