Remove “index.php” from URL - Codeigniter

前端 未结 12 1195
清酒与你
清酒与你 2020-12-03 16:05

I\'ve looked in the documentation of Codeigniter of removing the index.php from the URL when accessing different views, the code shows how to remove it with apa

12条回答
  •  南笙
    南笙 (楼主)
    2020-12-03 16:29

    You should change

    RewriteRule ^(.*)$ /index.php/$1 [L]
    

    to

    RewriteRule ^(.*)$ /code/index.php/$1 [L]
    

    You also need to modify the $config['index_page'] variable like this:

    $config['index_page'] = '';
    

    Please refer to my post at http://www.boxoft.net/2011/07/removing-index-php-from-codeigniter-2-0-2-url/ if you like.

提交回复
热议问题