CodeIgniter removing index.php from url

前端 未结 30 1473
[愿得一人]
[愿得一人] 2020-11-21 11:51

My current urls look like this [mysite]index.php/[rest of the slug].
I want to strip index.php from these urls.

mod_rewrite

30条回答
  •  遥遥无期
    2020-11-21 12:22

    you can go to config\config.php file and remove index.php value from this variable

    $config['index_page'] = 'index.php'; // delete index.php
    

    create .htaccess file and paste this code in it.

    
    
     Options +FollowSymLinks
    
     RewriteEngine On
     #Send request via index.php
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteRule ^(.*)$ index.php/$1 [L]
    
    
    

    good chance

提交回复
热议问题