How to solbe the page error when the rewriting activated

I have a problem ad I don't know if the problem is internal or not and how to identify the bug.

My first url before to activate the rewriting via htaccess is (with index.php):


After I activated the htaccess the url become (whithout index.php):


The problem is : I have a 404 error appear on the website when I click on the link.

Do you have ideas ? Thank you

Options -Indexes
Options +FollowSymlinks
Options -MultiViews

AcceptPathInfo on

<IfModule mod_rewrite.c>
RewriteEngine On

#rewrite the good directory in function your website
  RewriteBase /demo/
#1) redirect the client from "/index.php/foo/bar" to "/foo/bar"
RewriteCond %{THE_REQUEST} /index\.php/(.+)\sHTTP [NC]
RewriteRule ^ /%1 [NE,L,R]
#2)internally map "/foo/bar" to "/index.php/foo/bar"
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ /index.php/$1 [L]