Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have 2 domain, 1 is old domain, 1 is new domain

I setup my new site in new domain, but I wish to have the new www.example.com/testing/ redirect to the old domain's folder.

Can it be done? How?

share|improve this question
what platform (web server, language, etc)? – Joel Coel May 19 '10 at 3:39
Are both of your sites on the same machine as well as the same LAN? If so you may have to run two web servers on the same machine, that is two different installs of apache. The redirect itself can easily be done with a free service like DDNS dyndns.com/services/dns/dyndns – typoknig May 19 '10 at 3:41
thanks for reply first. i don't have info of the old domain yet. for new domain, is a web server, im using php and apache server. my client don't want to migrate some of the folders at old domain to the new domain. so, asking to do something like redirection. can we ask hosting provider help us to do this? – janeyew May 19 '10 at 4:27

migrated from stackoverflow.com May 19 '10 at 4:52

2 Answers

if you you are running apache you can create a .htaccess file in the directory of the page you wish to redirect and use:

Redirect 301 /OldDir/OldPage.html http://www.domain.com/NewDir/NewPage.html

or a RedirectMatch:

RedirectMatch 301 ^/OldDir/(.*)$ http://www.domain.com/NewDir/$1

share|improve this answer
hi crewe, thanks for ur answer first. but, i don't understand how to do this... actually my new domain dont have the folder called testing. the testing folder is located at the old domain. with this www.domain.com/testing/ url, i want to go to the old domain's testing folder pages. how can it be done? im not really know about hosting stuff... – janeyew May 19 '10 at 4:33
by placing the .htaccess file into the directory of the old domain, so that it points to the new one. have a read here: webmasterworld.com/forum23/3432.htm – Crewe May 19 '10 at 4:43

you can should use .htaccess, but if you want you can also use an easy php script :

    <?php
header("Location: http://www.example.com/"); /* Redirect browser */


?>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.