在Google中搜索时,将旧网址重定向到新网址

Recently I changed my site URL, when anyone searches for my site in Google it shows old URL when they click on it shows 404 error. Is there any possibility to redirect old URL to new URL when they click on old one.

Yes it is possible. Check the codes below.

<script>
window.location = "http://www.page-2.com";
</script>

just place it in your html.

For more details, visit How to redirect to another webpage in JavaScript/jQuery?

You should make a new file on your old URL that returns a 301 (moved permantently). For example:

<?php 
    header("HTTP/1.1 301 Moved Permanently"); 
    header("Location: http://www.New-Website.com"); 
?>

Or with php:

<?php
header("Location: http://yoururl");
?>

In old url ,you can use meta tag to route new url...

<META http-equiv="refresh" content="5;URL=http://www.example.com">