CodeIgniter Forums
URI Routing with Regular Expressions: How can I make it work??? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: URI Routing with Regular Expressions: How can I make it work??? (/showthread.php?tid=49918)



URI Routing with Regular Expressions: How can I make it work??? - El Forum - 03-07-2012

[eluser]Unknown[/eluser]
Hi,
I have a problem with two kinds of links, one that goes to the article (1539 is it's specific ID):

Code:
/Article_name-1539.html

and one that goes to the category (47 is it's specific ID):
Code:
/MainCat/SubCat-47/

I want to route them, I tryed these following codes without any result exept some 404 errors

Code:
$route['-(:num).html'] = "ArticleClass/function/$1/";

$route['-(:num)/'] = "CategoryClass/function/$1/";

how can I do this? Thanks in advance.




URI Routing with Regular Expressions: How can I make it work??? - El Forum - 03-08-2012

[eluser]Unknown[/eluser]
no one have a solution for that?