# \[OT\] Apache rewrite stuff

**URL:** <https://www.ruby-forum.com/t/ot-apache-rewrite-stuff/71840>\
**Category:** Rails\
**Created:** [February 22, 2006, 3:37pm UTC](https://www.ruby-forum.com/t/ot-apache-rewrite-stuff/71840 "2006-02-22T15:37:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicksnels](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@nicksnels](https://www.ruby-forum.com/u/nicksnels)\
**Post date:** [February 22, 2006, 3:37pm UTC](https://www.ruby-forum.com/t/ot-apache-rewrite-stuff/71840/1 "2006-02-22T15:37:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nicksnels](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@nicksnels](https://www.ruby-forum.com/u/nicksnels)\
**Post date:** [February 22, 2006, 4:10pm UTC](https://www.ruby-forum.com/t/ot-apache-rewrite-stuff/71840/2 "2006-02-22T16:10:04Z")

</div>

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](http://scottwalter.com/blog)  
Pro:Blog - [http://scottwalter.com/problog](http://scottwalter.com/problog)

----- Original Message ----  
From: Nick S. [removed\_email\_address@domain.invalid](mailto: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

---

<div class="post-metadata">

**Author:** ![nicksnels](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@nicksnels](https://www.ruby-forum.com/u/nicksnels)\
**Post date:** [February 22, 2006, 4:13pm UTC](https://www.ruby-forum.com/t/ot-apache-rewrite-stuff/71840/3 "2006-02-22T16:13:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nicksnels](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@nicksnels](https://www.ruby-forum.com/u/nicksnels)\
**Post date:** [February 22, 2006, 6:13pm UTC](https://www.ruby-forum.com/t/ot-apache-rewrite-stuff/71840/4 "2006-02-22T18:13:17Z")

</div>

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](http://blog.inlet-media.de)

---

<div class="post-metadata">

**Author:** ![nicksnels](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@nicksnels](https://www.ruby-forum.com/u/nicksnels)\
**Post date:** [February 22, 2006, 6:22pm UTC](https://www.ruby-forum.com/t/ot-apache-rewrite-stuff/71840/5 "2006-02-22T18:22:27Z")

</div>

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

b

---

<div class="post-metadata">

**Author:** ![nicksnels](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@nicksnels](https://www.ruby-forum.com/u/nicksnels)\
**Post date:** [February 22, 2006, 9:41pm UTC](https://www.ruby-forum.com/t/ot-apache-rewrite-stuff/71840/6 "2006-02-22T21:41:00Z")

</div>

Thanks, I’ll give it a shot!
