[OT] Apache rewrite stuff


#1

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


#2

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


#3

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


#4

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


#5

The entire world should just instantaneously forget that the “www.”
aberration ever
existed! :slight_smile:

b


#6

Thanks, I’ll give it a shot!