如何仅将“www.xyx.com/index.php?great=find”转换为“www.xyz.com”?

I am really having trouble understanding this. I used this code first.

<script>
if(typeof window.history.pushState == 'function') {
    window.history.pushState({}, 'Hide', '<?php echo $_SERVER['PHP_SELF'];?>');
}

But then, only the GET parameter (in this case, "great=find") is getting hidden. But the main page is showing "xyz.com/index.php" instead of "xyz.com" only(like it used to show earlier).

How can I solve this? Please provide detailed information if you suggest using .htaccess.

Try this in your Root/.htaccess :

RewriteEngine on
RewriteCond %{THE_REQUEST} /index\.php\?great=([^\s]+) [NC]
RewriteRule ^ /? [R,L] 

the easiest would be:

$_SERVER['SERVER_NAME']