Unable to remove index.php in WAMP with Codeigniter URL

后端 未结 1 653
无人共我
无人共我 2020-12-19 09:19

I want to remove the index.php in the URL but it doesn\'t work. Here\'s what I did:

  1. I enable the rewrite_module in my Apache then restart server
  2. I

相关标签:
1条回答
  • 2020-12-19 09:42

    Removing index.php in codeigniter on wamp apache server!

    When your using wamp make sure you have enabled Apache Modules "rewrite_module" restart server

    Second

    Try this htaccess in main directory of project

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

    Then go to application/config/config.php

    Find $config['index_page'] = 'index.php';

    And then make index.php blank

    Replace With $config['index_page'] = '';

    You may need to configure your routes

    CI3: http://www.codeigniter.com/user_guide/general/routing.html

    CI2: http://www.codeigniter.com/userguide2/general/routing.html

    0 讨论(0)
提交回复
热议问题