解析? 在htaccess

I'm trying to parse using htaccess

abc.com/a/b/c/?target=dd&a=b&c=d

(here everything after ? are random)

to

abc.com/index.php?q=

Means

a/b/c/?target=dd&a=b&c=d should go into index.php?q=

Here the problem is ? and & are not able to receive by PHP file

Value till a/b/c/ is received.

I want to convert:

abc.com/a/b/c/?target=dd&a=b&c=d

to

abc.com/index.php?q=a/b/c/?target=dd&a=b&c=d

How to first encode "?" and "&" to %3f and %26 respectively?

How to receive

a/b/c/?target=dd&a=b&c=d

in index.php?q=

I'm using this htaccess:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [NE,L,QSA]

But this is not able to transfer ? and & in PHP file !