Thursday, January 9, 2020

Codeigniter URL Routing, Suffix & Enable Query String

Wildcards:

We can use two types of wildcards, namely:
  1. :num –  Segment containing only numbers will be matched.
  2. :any – Segment containing only characters will be matched.

$route['(blog/:num)'] = 'tutorial/java/$1';
$route['(blog/:any)'] = 'tutorial/java';

Regular Expression
$route['blog/([a-zA-Z0-9]+)'] = 'tutorial/java';

No comments:

Post a Comment