CodeIgniter removing index.php from url

前端 未结 30 1440
[愿得一人]
[愿得一人] 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:20

    I think your all setting is good but you doing to misplace your htaccess file go and add your htaccess to your project file

    project_folder->htaccess

    and add this code to your htaccess

    RewriteEngine on
    RewriteCond $1 !^(index\.php|resources|robots\.txt)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
    

提交回复
热议问题