On 07 Oct 2008, at 15:35, Bharat Ruparel wrote:

> My Rails 2.1 app is changing DNS domains.  For example:
> From: www.oldcompany.com
> To:   www.newcompany.com
> The app uses Apache2, mongrel_cluster, MySQL.
> I would like the existing users who visit www.oldcompany.com URLs to  
> be:
> 1.  Notified via an HTML page that the site has changed from  
> oldcompany
> to new company and then redirect them to newcompany.
> This has to be done on the same server which gets new host name etc.
>
> I know that it can be done with mod_rewrite, but I am not proficient
> with it.  Is there a rewrite rule that I can put into my httpd.conf  
> file
> that will detect the incoming URLs with oldcompany hostnames and
> redirect them to a particular HTML page?
> For some time, I can keep both the new and old DNS names pointed to  
> the
> same IP address.


 From http://www.addedbytes.com/apache/url-rewriting-for-beginners/

To redirect an old domain to a new domain:

RewriteCond %{HTTP_HOST} old_domain\.com [NC]
RewriteRule ^(.*)$ http://www.new_domain.com/$1 [L,R=301]


Best regards

Peter De Berdt


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to