codeigniter 3 URL Remap

535 views Asked by At

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";
1

There are 1 answers

0
Muhammad Sadiq On

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

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";