Welcome Guest, Not a member yet? Register   Sign In
URL Rewriting: Name instead of ID
#16

[eluser]perfectsam[/eluser]
Oh well, I finally came to my senses and didn't implement it like I initially wanted. I took mddd's solution instead (thanks!) and my links look like this now:
Code:
base_url/author/123/john_doe

I just had to change all author links to
Code:
'author/'.$author->author_id.'/'.make_url($author->getName())

and used this route in routes.php:
Code:
$route['author/(:num)/[a-zA-Z0-9\-\_]+'] = "authors/show/$1";

which works perfectly. Thanks everyone again.


Messages In This Thread
URL Rewriting: Name instead of ID - by El Forum - 07-20-2010, 04:50 AM
URL Rewriting: Name instead of ID - by El Forum - 07-20-2010, 05:03 AM
URL Rewriting: Name instead of ID - by El Forum - 07-20-2010, 05:05 AM
URL Rewriting: Name instead of ID - by El Forum - 07-20-2010, 05:05 AM
URL Rewriting: Name instead of ID - by El Forum - 07-20-2010, 07:20 AM
URL Rewriting: Name instead of ID - by El Forum - 07-20-2010, 06:41 PM
URL Rewriting: Name instead of ID - by El Forum - 07-20-2010, 07:25 PM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 01:16 AM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 05:57 AM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 06:00 AM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 06:08 AM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 06:11 AM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 07:54 AM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 07:58 AM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 12:25 PM
URL Rewriting: Name instead of ID - by El Forum - 07-26-2010, 10:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB