I'm using below htaccess to remove index.php from my url in Codeigniter.
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
The problem is that user can still use below code to access the method :
http://example.com/index.php/controller/method
How can I redirect them to url without index.php or send them to an error page if they add index.php ?