[eluser]By AzraiL[/eluser]
[quote author="Michael Wales" date="1242415829"]I prefer example.com/this-is-my-title or example.com/category/this-is-my-title for SEO purposes.
Code:
// Catch example.com/category/this-is-my-title
$route['([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)'] = 'blog/post/$1';
// Catch example.com/category
$route['([a-zA-Z0-9-]+)'] = 'blog/category/$1';
Code:
<?php echo anchor(url_title($category, 'dash', TRUE) . '/' . url_title($title, 'dash', TRUE), $title);
Code:
function post($title_slug = NULL) {
if ($title_slug === NULL) {
// If the user somehow got here w/o having a slug
// send them to the homepage
redirect();
}
// Load the post from database using the unique slug
// If num_rows() === 0, throw a 404
// Else, Display view
}
[/quote]
Thanks man mucx :-)