Moving a web site

I happened to have the occasion to move a web site today. We moved from one server to another, but we didn’t move the DNS yet (because we hadn’t set up email and all of the internal lists we’re still running so, we had to figure out how to send traffic coming to* to* (and keep the pages the same).

One of the team members, Olivier, found this code:

RewriteEngine On

RewriteRule ^(.*)$$1 [R=301,L]

at WebMasterWorld. He then showed me how to test your redirects using this redirect tool.

4 Responses to “Moving a web site”

  • That’s rather a roundabout way of doing things. You could have easily changed the IP address of to the new host and that wouldn’t affect the mail at all, since DNS uses different records for email (MX records) and they currently point to

    Besides, there are easier ways of redirecting sites than using Apache’s mod_rewrite; Apache also has a Redirect directive that is easier to use in instances like this (I used this several years ago when my homepages moved from one domain to another and the entire redirect took only one line).

  • Our concern was to redirect traffic in a way that is compatible with search engines. MarketingFix had 2,200+ pages indexed in Google, and 301 redirects is what Google recommends (as opposed to meta redirects.) We want to be able to stop using eventually, so our goal is to have search engines index then drop We’re also concerned about showing duplicate content since that might hurt our ability to be indexed.

    No doubt there are many ways to do all that, this one seems to work properly so far.

    Regarding DNS/MX, it’s my experience that once you change DNS entries for the web server, MX entries are updated too, unless you ask your host company not to. We didn’t want the extra hassle (make a support request to handle MX differently from the main DNS, pray that it’s done on time) while we were busy with the migration.

  • Sean is right, mod_rewrite seems like using a sledgehammer to hang a painting. You can do something like this:

    Redirect permanent /

  • So John…if I moved to, what’s the best way for me to re-direct all old links over to Both sites are still live now. I’d love to have all old links be re-directed to corresponding links. Do I do it with an htaccess file? Thanks, I’m dumb with this stuff.

Leave a Reply