Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 最小化codeigniter的url_Php_Codeigniter_Url_Routes - Fatal编程技术网

Php 最小化codeigniter的url

Php 最小化codeigniter的url,php,codeigniter,url,routes,Php,Codeigniter,Url,Routes,如何最小化我的codeigniter项目url 从 到 或 您需要为此创建一个路由。将以下内容添加到路由配置文件中 $route['news/(:num)]=“/news/readnews/$1”你试过路由吗?我试过这个$route['news/(:id)']=“news/readnews/$1”;相关:查看CooDigier-Blog教程以了解更多的路由,并考虑使用“蛞蝓”代替URL中的数字。“(Num)”(“NUM”)的意思是,任何整数/数字都可以作为PARAM使用。它将不接受字符串或数字以

如何最小化我的codeigniter项目url 从


您需要为此创建一个路由。将以下内容添加到路由配置文件中


$route['news/(:num)]=“/news/readnews/$1”

你试过路由吗?我试过这个$route['news/(:id)']=“news/readnews/$1”;相关:查看CooDigier-Blog教程以了解更多的路由,并考虑使用“蛞蝓”代替URL中的数字。“(Num)”(“NUM”)的意思是,任何整数/数字都可以作为PARAM使用。它将不接受字符串或数字以外的任何内容。因此,如果您转到
http://localhost/newsite/20
它显示了
localhost/newsite/news/readnews/20
?我想您在其他地方遇到了配置问题。Wampserver主页绝对不应该出现,即使路线不正确。否,它显示的是Wampserver主页,而不是我的网站
http://localhost/newsite/news/readnews/20
http://localhost/newsite/news/20
http://localhost/newsite/20