Remove index.php from URL in Codeigniter

前端 未结 7 787
北恋
北恋 2021-01-02 15:48

I have done this lots of time. But than also I am stuck here again (in a different server) and can not figure out what is the issue.

Completed htaccess editing

7条回答
  •  我在风中等你
    2021-01-02 16:10

    Only three steps are require to remove index.php from url in Codeigniter in WAMP environment.

    1) Create .htacess file in parallel to application holder and just copy past the following code:

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

    2) Change $config['index_page'] to blank in config.php in application folder as below:

    $config['index_page'] = '';
    

    3) Enable “rewrite_module” of apache.

    Restart your apache and its done.

    Details : http://sforsuresh.in/removing-index-php-from-url-of-codeigniter-in-wamp/

提交回复
热议问题