Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jdl8422

macrumors 6502
Original poster
Jul 5, 2006
491
0
Louisiana
I have a domain and I want to redirect it to a new site. I want to use a HTML page or PHP page, which ever works, and when they go to this site its just an image and a message that says "www.siteX.com has moved to www.siteY.com. You will be directed in 5 seconds" Ive seen similar php code in email forms. Something along the lines of: if success thankyou.html. Any ideas on how to do this, or where I can find out?. Thanks

PS: This is not for spam or anything like that. These are both my sites
 
I was looking for the best way, I didnt want to risk the chance of being marked as any kind of spam because I read that you can be de-indexed.
 
Well, I don't think there's a better way than what W3C officially suggests.
 
As an added piece, having that one file will only apply to people that go to your home page. If they've bookmarked any other page than that, they will see a error 404 page instead. You can create a redirect page for each page that was at the site, but that would be laborious and unnecessary.

If your old site is on an Apache web server, you can create some redirects from there. You can go about this two ways, either redirect to your new site or redirect to your redirect page. The latter helps orient people to realize your site has moved so can be helpful. Though, if your site has retained its structure (i.e., olddomain.com/a_page.html = newdomain.com/a_page.html) then you could use the Apache redirect to put them on the page they really want, rather than at the home page of your new site. So there's pros and cons of both ways. I'll leave it to you to decide what will be best for your situation.

OK, so how to do the redirects:

Basic .htaccess file for redirect: (only use one of the numbered options below)
Code:
[B]RewriteEngine On[/B]
# 1.) assumes new site has same structure
[B]Redirect permanent /(.*) http://www.newdomain.com/$1[/B]
# 2.) redirect visitor to your redirect page on old web site (assuming your
#      redirect page is index.html in the root directory
[B]Redirect permanent /.+ http://www.olddomain.com/[/B]
Place the .htaccess file in your root folder of the site.

Links for reading:
http://httpd.apache.org/docs/1.3/mod/mod_alias.html
http://www.yolinux.com/TUTORIALS/ApacheRedirect.html
http://www.webmasterworld.com/forum92/82.htm
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.