redirect certain certain urls to a subdomain on a different server

avir
avir used Ask the Experts™
on
We are building a new site on a new server and plan to transfer our current domain name to the new site/server. Some of the pages in our current site will remain on the current server and in order to continue to access those pages we have created a subdomain, which points to the current server. Do I create 301 redirects  from the new server to those pages with the new subdomain name? Even though those pages won't ever have existed on the new server?
For instance:
Currently I have www.example.com/page which will continue as subdomain.example.com/page when we make the switch over. Do I create a 301 redirect on the new server:  /page -> subdomain.example.com/page?
I don't know if it makes a difference but the new server is linux and will be hosting drupal and the old server is windows 2012.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2004

Commented:
Yes, that is exactly what you do.  The new server does not need to know anything about the pages beyond the fact that they are being redirected elsewhere.
Commented:
Not sure I've ready this right but IMO:

As you will point subdomain.example.com in DNS to the new server IP any new links will presumably point to the new location so don't need any redirects as the link goes directly there but yes if you want any old links to still work you will need the redirect /page -> subdomain.example.com/page.  OS / web server doesn't make any difference.

Author

Commented:
Thanks for the input. I'm not  a Drupal expert at all and the person who is building the site said he knows of a Drupal module that might be used, but he's not  familiar with it. I guess the main question is what kind of urls the module will accept, if it will accept external urls.
Top Expert 2004
Commented:
There are several Drupal modules capable of handling redirection.  Make sure you pick one that can handle *external* redirection - some are just meant to be more robust versions of url_alias.

In the worst case, you can put the redirects in your .htaccess or virtual host configuration.

Also, to clarify about your DNS:

Right now, you have "www.domain.com" pointed at server1.  You are building server2, which will take over hosting for www.domain.com, but some of the pages are meant to stay at server1.  You are creating a new subdomain - oldpages.domain.com - to handle those requests, and they will continue to be served from server1.

That means when you move, the A record for domain.com should point to server2.  If you have an A record for the www subdomain, it should point there as well; you may just want to use a CNAME for ease of maintenance.  The A record for oldpages should point at server1.  Server1's conf files should be modified to respond to oldpages.domain.com.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial