[eluser]srpurdy[/eluser]
[quote author="msy07" date="1344481343"]Thank you for the replies!
[quote author="PhilTem" date="1344443785"]Please show us your view and how you're creating the links! This way it's easier for us to help you![/quote]
This is the view for showing up all the news.
Code:
<?php foreach ($news as $news_item): ?>
<h2><?php echo $news_item['title'] ?></h2>
<div id="main">
<?php echo $news_item['text'] ?>
</div>
<p><a href="news/<?php echo $news_item['slug'] ?>">View article</a></p> //this is the line that produces the link to view the specific post
<?php endforeach ?>
[quote author="CroNiX" date="1344446041"]Why add the trailing slash anyway? It doesn’t provide any benefit unless something comes after.[/quote]
I was just trying to figure out why it behaves that way.
[/quote]
Actually has Nothing to do with codeigniter. That's how paths work.
Change this
Code:
<a href="news/<?php echo $news_item['slug'] ?>">View article</a>
to This
Code:
<a href="<?php echo base_url();?>news/<?php echo $news_item['slug'];?>">View article</a>
It's always good practice to use base_url or site_url because this saves a lot of problems.