• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting Problem in Linking

#1
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
Reply

#2
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

Reply

#3
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
Reply

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

Reply

#5
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.
Reply

#6
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.

Reply

#7
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".
Reply

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

Reply

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

#10
Where is your document root in apache is it

http://localhost

or

http://localhost/CodeIgniter

Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.