Remove index.php of codeigniter

前端 未结 3 589
灰色年华
灰色年华 2020-12-19 22:15

Yes, another one of these. I\'ve tried everything I could find on the search with no luck.

In my httpd.conf (running centos and apache2):



        
3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-19 22:35

    The rules in the original post (and in the CI user guide) can be used to allow URLs to work without /index.php/ in them, but will NOT remove /index.php/ from existing URLs.

    You can set $config['index_page'] = ''; (removing index.php) in the CI config to remove index.php from CI-generated URLs.

    If the original rules do not work, please give these rewrite rules a try:

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

提交回复
热议问题