Remove index.php from url in CodeIgniter 3

前端 未结 6 1598
死守一世寂寞
死守一世寂寞 2020-12-14 13:42

I am doing a project in CodeIgniter 3. I need to remove index.php from url. For that help me to get .htaccess file for CodeIgniter 3 and also where

6条回答
  •  伪装坚强ぢ
    2020-12-14 14:35

    In your config.php make following changes.

    $config['index_page'] = '';
    

    And add .htaccess file in main project directory with following content

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]  
    
    
    AcceptPathInfo On
    
    

提交回复
热议问题