Results 1 to 2 of 2
Jun 9, 2009, 17:21 #1
Simple routing issue (CodeIgniter question)
I need my articles to be working directly through my domain:
$route[':any'] = "article";
So my question is how can I exclude a list of controllers? I believe I should use Regular Expressions but I donít know how.
If you prefer you can use regular expressions to define your routing rules. Any valid regular expression is allowed, as are back-references.
Note: If you use back-references you must use the dollar syntax rather than the double backslash syntax.
A typical RegEx route might look something like this:
$route['products/([a-z]+)/(\d+)'] = "$1/id_$2";
In the above example, a URI similar to products/shirts/123 would instead call the shirts controller class and the id_123 function.
You can also mix and match wildcards with regular expressions.
Your help would be greatly appreciated.Why It Doesn't Work?!
Jun 9, 2009, 23:39 #2
- Join Date
- Apr 2008
- Temecula, CA
- 0 Post(s)
- 0 Thread(s)
It's not what you want, but it's more CI friendly to do something like this:
$route['article/(.+)/([0-9]+)'] = "article/show/$2";
which allows you to not cripple the rest of your CI.