Forum: Ruby on Rails [OT] Apache rewrite stuff...

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cb610750ee94ca103aef4b2dc7b1b768?d=identicon&s=25 Nick Stuart (Guest)
on 2006-02-22 15:37
(Received via mailing list)
Hi all, a little off topic, but was wondering what the best way is to
re-write incoming requests so that they all end up at the same domain.
For example, if I had:
my_domain.net
my_domain.com
my_domain.org

Whats the best way to map/redirect all of these to
www.my_domain.com

?

I know its possible, just not sure what to add for rules/virtual hosts
in my apache config.

Thanks for the help!
-Nick
1b275ea705cc1671f13105d29684cbec?d=identicon&s=25 Scott Walter (sfwalter)
on 2006-02-22 16:10
(Received via mailing list)
Wouldn't this be a simple dns config?  Since they are different domains
just have all the domains point to the same ip address of the server.

----------------------------------------------------------------------------------------------------
What's an Intel chip doing in a Mac? A whole lor more that it's ever
done in a PC.

My Digital Life - http://scottwalter.com/blog
Pro:Blog - http://scottwalter.com/problog

----- Original Message ----
From: Nick Stuart <nicholas.stuart@gmail.com>
To: rails@lists.rubyonrails.org
Sent: Wednesday, February 22, 2006 8:35:29 AM
Subject: [Rails] [OT] Apache rewrite stuff...

Hi all, a little off topic, but was wondering what the best way is to
re-write incoming requests so that they all end up at the same domain.
For example, if I had:
my_domain.net
my_domain.com
my_domain.org

Whats the best way to map/redirect all of these to
www.my_domain.com

?

I know its possible, just not sure what to add for rules/virtual hosts
in my apache config.

Thanks for the help!
-Nick
Cb610750ee94ca103aef4b2dc7b1b768?d=identicon&s=25 Nick Stuart (Guest)
on 2006-02-22 16:13
(Received via mailing list)
Well currently they all do point to the same IP address, and it works.
My point was though to have the URL re-written to show a constant
address no matter how they come to the site.

-Nick
Bf66e10c8fc4abefebde0425e7f6f15a?d=identicon&s=25 Norman Timmler (Guest)
on 2006-02-22 18:13
(Received via mailing list)
Am Mittwoch, den 22.02.2006, 09:35 -0500 schrieb Nick Stuart:
> Hi all, a little off topic, but was wondering what the best way is to
> re-write incoming requests so that they all end up at the same domain.
> For example, if I had:
> my_domain.net
> my_domain.com
> my_domain.org
>
> Whats the best way to map/redirect all of these to
> www.my_domain.com

RewriteCond %{HTTP_HOST}  !^(.*)my_domain\.com$ [NC]
RewriteRule (.*)          http://%1my_domain.com/$1 [R]

--
Norman Timmler

http://blog.inlet-media.de
4005a47a8f2ceee49670b920593c1d52?d=identicon&s=25 Ben Munat (Guest)
on 2006-02-22 18:22
(Received via mailing list)
The entire world should just instantaneously forget that the "www."
aberration ever
existed! :-)

b
Cb610750ee94ca103aef4b2dc7b1b768?d=identicon&s=25 Nick Stuart (Guest)
on 2006-02-22 21:41
(Received via mailing list)
Thanks, I'll give it a shot!
This topic is locked and can not be replied to.