I have read alot about this but have never actually managed to get it to work - here is what I need to do: A site is currently at: http://www.sub.domain1.com And I want to redirect it to hrrp://www.sub.domain2.com The file structure will be exactly the same on the new domain, so the only thing that will be changing is *domain1* to *domain2*. I'm sure this isn't a complex task, I just haven't managed to figure out how to do it, so any help is appreciated
It all depends on your hosting provider, whatever web host I use, I have the following directories under www www/domain1.com/ www/domain2.com /, I will just move the directory sub from www/domain1.com/ to www/domain2.com
Unless your webhosting provider is allowing you to zip the folder sub and upload it to new webhosting provider and unzip, I think you might have to copy the content yourself manually. You have lot of work, since you need to manualy create the same file structure in new hos
copying the content / filestructure isn't a problem, its the redirect that is causing issues at the moment.
Ok, you can use this as index.htm of sub.domain1.com <HTML> <HEAD> <META HTTP-EQUIV="refresh" content="5;URL=http://sub.domain2.com/"> <TITLE>This Page has moved</TITLE> </HEAD> <BODY> <a href="sub.domain2.com"> Click here if you do not get redirected with 5 seconds </a> </br> </BODY> </HTML>
I need to do it properly for the sake of the searhc engines and my traffic so I need to be able to 301 rather than meta redirect. Also I need to be able to redirect all old pages to their equivalent new ones - so if someone went to http://www.sub.domain1.com/dir1/dir2/index.html they would be redirected to http://www.sub.domain2.com/dir1/dir2/index.html
If your domains are with namecheap, you can edit domain1.com's All Host Record where you can create a entry for sub so that sub.domain1.com gets redirected to sub.domain2.com
I won't be setting up any kind of redirects via my domain registrar - I will be doing it via htaccess using modrewrite as this is the most search engine friendly way - I know this, I just don't know how to do it properly.
that only redirects that specific page - i need to redirect the entire file structure as stated above, so http://www.sub.domain1.com/dir1/dir2/index.html would be redirected to http://www.sub.domain2.com/dir1/dir2/index.html