Q:

How to remove part of URL and exclude path from rewriting in .htaccess?

I have this in my .htaccess:
RewriteEngine on 
RewriteRule !^/clients/index.php
RewriteRule ^clients/(.*) $1/$2

Idea is to rewrite all urls with clients in URL (eg. mydomain.com/clients/cart.php to mydomain.com/cart.php) but exclude this rule for mydomain.com/clients/index.php.
Using above rule, without my exclude rule works fine, but when I add RewriteRule !^/clients/index.php
rule gives me Internal Server Error. 
Question is how to exclude full path from rewriting?

A:

Change
RewriteRule
!^/clients/index.php

to
RewriteCond %{REQUEST_URI} !^/clients/index.php

REWRITE :
RewriteEngine on 
RewriteCond %{REQUEST_URI} !^/clients/index.php
RewriteRule ^clients/(.*) $1/ [NC,L]

