Forum Moderators: buckworks & webwork

Message Too Old, No Replies

redirecting old urls

redirecting old urls

         

chavezr

12:19 am on Dec 31, 2003 (gmt 0)

10+ Year Member



We’re currently running two sites on two different web servers (hosting companies). We want to take down our old site and put all of our efforts into our new site. The challenge is that the old site has several pages indexed on search engines. I can redirect from the old site to the new site with our domain host. However, I want to set a 301 permanent move for all pages, especially lower level pages to the new site. Is this possible due to the fact the sites are on two separate web servers? Any recommendations are highly appreciated.

jdMorgan

1:10 am on Dec 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



chavezr,

Sure. You could do the following:

  • Point the DNS for the old domain to your new domain's server.
  • On the new server, check incoming requests for HTTP_HOST
  • Redirect the requests for old pages to the corresponding new pages in the new domain
  • Redirect all other request for the old domain to the home page or to an errorpage in your new domain

    Of course, you'll want to put the redirects in place before you change the DNS, but the above demonstrates the path a request for the old domain would take.

    How you implement this depends on your server type. It should be simple using mod_rewrite on Apache, or the control panel or ISAPI filters on windows servers.

    Technically, HTTP_HOST is only guaranteed to be defined for HTTP/1.1 requests. But this method will cover almost all requests, including almost all search engine spiders which advertise as HTTP/1.0, but do include the HTTP_HOST header in requests. If losing a very few of the HTTP/1.0 requests worries you, then you may want to set up a separate hosting account on the new server, and redirect from there.

    Jim

  • RTM Communications

    1:36 am on Dec 31, 2003 (gmt 0)

    10+ Year Member



    Argh, now *that* is frustrating. I had just finished a 3 paragraph reply... when I checked back and saw that Jim had basically said exactly what I was going to - only better, and faster.

    So, do as Jim suggests.

    :)