When I first launched my site, URLs were in the following format:
project.php?projectID=1&pageID=2
A few years ago I modified my .htaccess
You need to match against the request and not the URI. The URI won't have any of the query string in it:
RewriteCond %{THE_REQUEST} \ /+project\.php\?projectID=([0-9]+)(?:&pageID=([0-9]+)|)
RewriteRule ^ /project/%1/%2? [L,R=301]
RewriteCond $1 !^(index\.php)
RewriteRule ^(.*)$ index.php/$1 [L]