Friendly URLs/Slugs for content |
[eluser]doubleplusgood[/eluser]
Hi there, I'm trying to implement friendly URLs for a 'Testimonials' section of my website. I *think* I am almost there with it, except that when I try to view a testimonial I am presented with a 404 error. This is my testimonials Controller; Code: class Testimonials extends Controller { And this is my Model; Code: class Testimonials_model extends Model { My views/testimonials/index.php contains the following code to access an individual testimonial; Code: <?php foreach($testimonials as $testimonial):?> But, I get the 404 error trying to access one of the testimonials at; http://localhost:8888/ci/mgbuilders/test...number-one I was wondering if anyone might be able to spot any schoolboy errors? Incidentally, I am storing the slug as a separate column for each testimonial in the database. Thank you.
[eluser]bretticus[/eluser]
Well, unless you have an .htaccess files hiding your index.php page, your URL should probably be: http://localhost:8888/ci/mgbuilders/inde...number-one Not sure why you are trying to surf directly to your views either. Perhaps, take another look at the manual.
[eluser]doubleplusgood[/eluser]
@bretticus I am indeed hiding the index.php. I would also like to hide the 'testimonial' segment of the URL so that users will view each testimonial at something like; http://localhost:8888/ci/mgbuilders/test...number-one
[eluser]mattpointblank[/eluser]
Shouldn't http://localhost:8888/ci/mgbuilders/test...number-one be http://localhost:8888/ci/mgbuilders/test...number-one instead?
[eluser]doubleplusgood[/eluser]
@mattpointblank Thanks man, I think you could be right. I guess I shouldn't be working at 2am. Lol |
Welcome Guest, Not a member yet? Register Sign In |