Php Codeigniter框架中的MVC
我在使用CodeIngniter框架构建的站点中看到,URI中有'index.php'。有必要吗 例如: example.com/index.php/products/view/shoes 有没有可能做到: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
example.com/products/view/shoes像这样的站点正在使用“mod_rewrite”,这是Apache的一个模块。只要您的web服务器上安装了mod_rewrite,您就可以设置htaccess规则,通过index.php(或您想要的任何页面)路由web请求,如/products/view/shoes。URL重写是一个涉及多个方面的大主题,您可以通过一些谷歌搜索了解更多内容
是的,当然,您必须使用.htaccess重写路由,+1以链接到具有CI特定解决方案的官方文档。