Oh, ouch. Oh, ouch. I think you have at least two problems and possibly more.
When you say "search results" do you mean the page URL that's visible in search-results listings? Or do you mean that when you click on a search result, you end up on a page with extraneous stuff?
RewriteCond %{REQUEST_FILENAME}.php !-d
Unless I'm reading this upside-down and sideways, it means "If you add '.php' to the end of the requested filename, it is not an existing directory." Uhm.. Wouldn't this condition
always succeed?
You need two things. One, find out where that extra "xyz.php" business is coming from and put a stop to it. Two, snip off the extra bit.
If you are lucky, the second part can be achieved by
RewriteRule ^([^.])\.php(.+) $1.php [R=301,L]
meaning simply "If there is any more stuff of any kind after the first occurrence of '.php', get rid of it." Query strings don't count as "more stuff" so you need not think about them. Unless you're
also getting garbage in your queries.
Which is why I started out saying "
at least two problems".