Apache Server configuration support - Changing servers, mod_rewrite to redirect?

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > August 2006 > Changing servers, mod_rewrite to redirect?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Changing servers, mod_rewrite to redirect?
Jason

2006-08-30, 7:38 am

I'm in the middle of changing servers, going from a virtual host to a
dedicated server. But I've had a major problem in the past with the
local cable internet provider taking literally WEEKS to update their
servers to show the new DNS address; this means that, for weeks, people
are pinging the old server instead of the new.

This isn't just the website, either; the emails sent from cable
customers are directed to the old server, as well.

Since I'm currently working on moving 75 accounts, this is really too
much stress to bear! So, I'm trying to find a way to force the visitors
with cable internet to see the new server.

I've been researching this for awhile, and the only solution I've found
is to use mod_rewrite on the old server to redirect the visitor to the
new server.

Now, I have 2 questions for you guys:

1. If I do this, is this recipe correct? Let's say their account is at
www.example.com, and the temp account on the new server is
http://192.168.2.1/~example. Is this the recipe I would upload to the
old server?

RewriteEngine on
RewriteRule ^/~(.+) http://192.168.2.1/~$1 [R,L]


2. Is there a better / more reliable way to accomplish the same thing?
I'm open to pretty much anything at this point.

TIA,

Jason

Davide Bianchi

2006-08-30, 7:38 am

On 2006-08-30, Jason <jwcarlton@gmail.com> wrote:
> This isn't just the website, either; the emails sent from cable
> customers are directed to the old server, as well.


This could be fixed by configuring correctly your mail server to relay
the mail to the correct server, acting as a middle-man.

> So, I'm trying to find a way to force the visitors
> with cable internet to see the new server.


Configure the old server as a proxy, using IPTable is the simplest way,
every connection (no matter what) will be redirected to the 'correct' server.

> 1. If I do this, is this recipe correct? Let's say their account is at
> www.example.com, and the temp account on the new server is
> http://192.168.2.1/~example. Is this the recipe I would upload to the
> old server?
>
> RewriteEngine on
> RewriteRule ^/~(.+) http://192.168.2.1/~$1 [R,L]


This way the client will be redirected to 192.168.2.1, but the client
could have a different idea of WHERE IS 192.168.2.1, suggestion: use mod_proxy.

Davide

--
Every time you apply the LART, you give some poor luser a chance to
redeem itself and RTFM next time.
-- Infinitas on alt.sysadmin.recovery
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com