控制器的url         localhost/index.php/welcome/index,总是带着index.php 怎么去掉?

解决方案 »

  1.   

    config文件下routes.php设置路由正则匹配重新指向路径,如:$route['(\d+).html']="detail/index/$1";
      

  2.   

    去中文官网看教程。
    rewrite就可以做到了。需要服务器空间的权限
      

  3.   

    index.php是入口。如果不想带这个,必须操作.htaccess或者nginx的conf
      

  4.   

    假定你用的是 apache 则RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]