How can I route to specific URL for URL having dynamic id. Suppose orginal URL is
http:localhost/c2c/init/product/5 // here 5 is the id of the product.
In route.php
$route["product/iphone-on-sale"] = "init/product/5";
But its not routing to http:localhost/c2c/product/iphone-on-sale
when when original URL is entered.
You can try this
$route["product/iphone-on-sale/(:num)"] = "init/product/$1";
and your url will be
http://localhost/c2c/product/iphone-on-sale/5
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.