0
   

How to redirect from one domain to another

 
 
Reply Tue 6 Oct, 2009 05:17 am
I have one domain and t to have everyone that goes to that site to see a rediect page that tells them that we have move to another domain so that they can update there favorites. How do I do it and do I have to keep the old host live or can I shut it down.
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 2,665 • Replies: 3
No top replies

 
Robert Gentel
 
  1  
Reply Tue 6 Oct, 2009 11:05 am
@roysnider,
It's better to just implement a 301 redirect, as that will not only redirect visitors but also will transfer your search engine rankings and avoid loss of search traffic. The only downside is that you won't be displaying a notice of what is happening, but it's best to keep the redirect permanently in place anyway so that shouldn't matter. Old bookmarks would just go to the new domain without the user needing to do anything.

As to how to do this it depends on what technology you are using, with an apache webserver (most commonly used on Linux servers) it's easiest as you can use mod_rewrite to redirect the whole site. Here is an example of how to do it:

1) make or edit a file called .htaccess in your old site's root folder.
2) put the following code in your htaccess file, replacing the domain with your new site's domain of course:

Code:RewriteEngine on
RewriteRule (.*) http://www.able2know.org/$1 [R=301,L]


What this does is turn on mod_rewrite, and then capture any request on the old site and append it to the new domain with a 301 header (which means "permanently moved").
0 Replies
 
intoitdaily
 
  1  
Reply Sat 17 Oct, 2009 10:31 am
Great suggestions Robert!

However, if you want to do a standard "We have moved" redirect, it's a very simple javascript function that looks something like this:

Code:
<html>
<head>
<title>We've Moved!</title>
<script type="text/javascript">
function redirect(){
window.location="http://www.yournewsite.com";
}
</script>
</head>

<body onload="setTimeout('redirect()',4000)">

<h1>We've moved! You will be redirected shortly...</h1>

</body>
</html>


the 4000 in the onload is milliseconds, meaning 4000 is 4 seconds. 5000 would be a 5 second pause, then a redirect. Set the amount of time you want there in milliseconds. Good Luck!
Robert Gentel
 
  1  
Reply Mon 19 Oct, 2009 11:04 am
@intoitdaily,
Yup, but do note that this way you do not preserve your search engine rankings, which is almost always more important than doing the splash notification of the redirect.
0 Replies
 
 

Related Topics

Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » How to redirect from one domain to another
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 11/12/2024 at 06:28:53