views:

138

answers:

3

I have two domains ("this_site.com" and "that_site.com") that I want to point to the same place (same set of files).

BUT

What I really want to do is maintain the original URL in the address bar while the visitor accesses the different pages.

Example: The primary domain holding the web files is "this_site.com". If I type in "that_site.com" in the address bar, I want the address bar to keep displaying "that_site.com" no matter where they go on the web site. Normal domain redirection causes the URL displayed in the address bar to change to the 'master' domain (i.e. the visitor that typed in "that_site.com" will see the address bar's URL change to "this_site.com").

Is there some sort of .htaccess trick that I can employ to do this?

What I'm trying to do is NOT confuse visitors who visit one URL and find themselves on a different URL as well as avoid the additional expense and trouble of having to maintain two separate hosting accounts.

A: 

You'll want to use ProxyPass or the [P] flag of RewriteRule for this. Note that ProxyPass needs to be in the server config.

Ignacio Vazquez-Abrams
A: 

no htaccess can do that.

simple frame/iframe is your answer.

DennyHalim.com
A: 

If you can edit apache's virtual host configuration, just add

ServerAlias that_site.com

To this_site.com's vhost configuration. Unfortunately, you can't make that change in an htaccess file. If you don't have access, this is maybe something your hosting company can setup for you.

mikeocool