Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/258.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框架中的MVC_Php_Codeigniter - Fatal编程技术网

Php Codeigniter框架中的MVC

Php Codeigniter框架中的MVC,php,codeigniter,Php,Codeigniter,我在使用CodeIngniter框架构建的站点中看到,URI中有'index.php'。有必要吗 例如: example.com/index.php/products/view/shoes 有没有可能做到: example.com/products/view/shoes像这样的站点正在使用“mod_rewrite”,这是Apache的一个模块。只要您的web服务器上安装了mod_rewrite,您就可以设置htaccess规则,通过index.php(或您想要的任何页面)路由web请求,如/pr

我在使用CodeIngniter框架构建的站点中看到,URI中有'index.php'。有必要吗

例如: example.com/index.php/products/view/shoes

有没有可能做到:


example.com/products/view/shoes

像这样的站点正在使用“mod_rewrite”,这是Apache的一个模块。只要您的web服务器上安装了mod_rewrite,您就可以设置htaccess规则,通过index.php(或您想要的任何页面)路由web请求,如/products/view/shoes。URL重写是一个涉及多个方面的大主题,您可以通过一些谷歌搜索了解更多内容


是的,当然,您必须使用.htaccess重写路由,

+1以链接到具有CI特定解决方案的官方文档。