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.
Nick S. (Guest)
on 2006-02-22 16: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
Scott W. (Guest)
on 2006-02-22 17: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 S. <removed_email_address@domain.invalid>
To: removed_email_address@domain.invalid
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
Nick S. (Guest)
on 2006-02-22 17: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
Norman T. (Guest)
on 2006-02-22 19:13
(Received via mailing list)
Am Mittwoch, den 22.02.2006, 09:35 -0500 schrieb Nick S.:
> 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 T.

http://blog.inlet-media.de
Ben M. (Guest)
on 2006-02-22 19:22
(Received via mailing list)
The entire world should just instantaneously forget that the "www."
aberration ever
existed! :-)

b
Nick S. (Guest)
on 2006-02-22 22:41
(Received via mailing list)
Thanks, I'll give it a shot!
This topic is locked and can not be replied to.