hide index.php codeigniter / htaccess / rewrite mod

change

example.com/index.php/news/article/my_article

into this :

example.com/news/article/

 

 using a .htaccess

 

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

 

apache.conf :

<Directory /var/www/>

        Options Indexes FollowSymLinks

        AllowOverride All

        Require all granted

</Directory>