I have moved my site to a new server with a new url. Can any one help me with the code so that when a visitor arrives at my old site they are automatically redirected to my new site? Thank you.
I have moved my site to a new server with a new url. Can any one help me with the code so that when a visitor arrives at my old site they are automatically redirected to my new site? Thank you.
Best is using 301 redirect permanently. How is it done depends on the server configuration. Sometime you can use php:
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.site.com");
header("Connection: close");
?>
Second best is using the META refresh tag
<meta http-equiv="refresh" content="10;url=http://www.site.com/">
Leave this 10 secs time to prevent troubles with SE.
javascript is not a good solution:
<script>
window.location.replace("http://www.site.com");
</script>