but if i request xyz?id=1 it still send only xyz. Is there any way to send whole string no matter what is string
As you mentioned if you request example.com/xyz
or example.com/xyz?id=1
you want to get all the parameters. Then use this. Notice the QSA
flag. That will append the requested query string. I think this is the answer you're looking for.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /myfile.php?url=$1 [QSA,L]
So if you request this example.com/xyz?id=1&h=2
Your PHP print_r($_GET);
output will be this.
Array ( [url] => xyz [id] => 1 [h] => 2 )