I want to remove the index.php in the URL but it doesn't work.
Here's what I did:
- I enable the rewrite_module in my Apache then restart server
I edit the .htaccess in my codeigniter folder. I add this according to the example in the documentation.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Then I also remove the index.php in app/config
Then I create a simple controller:
class Users extends CI_Controller {
public function __construct() {
parent::__construct();
}
public function index() {
echo "hello world";
}
}
And when I access this URL:
http://localhost/order_menu/users
I got this error:
Not Found
The requested URL /order_menu/users was not found on this server.
Can you help me with this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…