CodeIgniter removing index.php from url

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

    try this one.It may help you as its working for me.

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* index.php/$0 [PT,L]
    

    put the code in your root htaccess file.and make sure that you have

    $config['index_page'] = '';
    

    in your config file.

    Please let me know if you face any problem.

提交回复
热议问题