简体   繁体   中英

codeigniter 3 URL Remap

I am trying to remap all old URLs http://www.example.com/ipranges.php?reqinfo=180.94.79.0-180.94.79.255 in my codeigniter 3 but its not working. here is my route for this. Can someone help? Thanks

$route['ipranges.php?reqinfo=/(:any)'] = "ipinfo/ipranges/$1";

- codeigniter is using uri segments , and there is " ipranges.ph p..."

in your routes which is not allowed and can't be used in codeigniter.

-In codeigniter url->

there is 1st segment which indicates controller , second segment point to method and third and so on, are the parameters to method.

-so here is url=> www.example.com/controller/method/parameter......

-if you are using routing,than you can remap them as ----- www.example.com/slug

--Here in routes.php

$route['slug'] = "controller/method/$1";

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM