Forum Moderators: phranque
I'm really new to web hosting and web page design and just about everything. Here's my problem: I bought a new domain name and want to create a permanent redirect from my old domain to my new domain. Problem is, I'm hosting multiple domains on one host by "attaching" a domain name to a subdirectory of my main domain name.
I read about using a ".htaccess" file to create a 301 redirect, but as simple as it sounds, I've been unsuccessful at creating the redirect. My domains are hosted on a Linux server. Can someone tell me exactly what to put in a ".htaccess" file if my domains are as folows: www.old-domain.com to www.new-domain.com?
Or should I be using some other method for creating a redirect? I think my host is using PHP v.4 (whatever that means). I don't know anything about IIS. Sorry for souding like a complete idiot. I'm still learning <g>.
Bob
All I did was create a .htaccess.txt file with Windows Notepad. In the file, I put in the following: redirect 301 / [new-domain.com...]
I uploaded the file to the directory where my old domain name resided, and changed the file name to ".htaccess"
It works like a charm! When I click on a link to my old website, or any pages on my old website, the redirect instantly takes me to the new domain. Links to pages on my old website get redirected to the same page on my new website as well. It happens instantaneously. I'm a little surprised at how easy it was <g>.
Bob
[edited by: Zebra_Tech at 3:46 pm (utc) on Sep. 8, 2008]