简体   繁体   English

codeigniter 3 URL重映射

[英]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. 我正在尝试在我的codeigniter 3中重新映射所有旧的URL http://www.example.com/ipranges.php?reqinfo=180.94.79.0-180.94.79.255 ,但它无法正常工作。 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..." - codeigniter使用uri段,并有“ ipranges.ph p ...”

in your routes which is not allowed and can't be used in codeigniter. 在您的路线中,这是不允许的,并且不能在codeigniter中使用。

-In codeigniter url-> -在codeigniter网址->

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...... -因此这是url => www.example.com/controller/method/parameter......

-if you are using routing,than you can remap them as ----- www.example.com/slug -如果您使用路由,则可以将它们重新映射为----- www.example.com/slug

--Here in routes.php --Here在routes.php

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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